Motorola Axiom CMD11E1 Betriebsanweisung Seite 55

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 101
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 54
4.5. ON YOUR OWN! 55
anda #$0F
; in C, use: getchar() & 0X0F
Use the above sequence to let the user specify the count. When expecting
the user to enter a value, it is a good idea to prompt the user. Your code
may look something like:...
;; various equates and comments...
;
;
org $2000
ldx #prompt
jsr outstrg
jsr inchar
anda #$ff
staa count
;
; rest of the code goes here
org $3000
; various RMB
count RMB 1
v RMB 1
total RMB 1
prompt fcc /How many times please? /
fcb 4
6. Write a program that will do the following:
(a) Get a number between 0 and 9 from the user and store in a variable
called v1.
(b) Multiply v1 by 4 and store the result in a variable called v2.
(c) Add v1 and v2 and store the result in a variable called v3.
(d) Multiply v3 by 2 and store the result in a variable called v4.
(e) Print the values in the variables separated by a comma. In the last
lab, you saw an example for printing a colon. You can use the same
approach.
Seitenansicht 54
1 2 ... 50 51 52 53 54 55 56 57 58 59 60 ... 100 101

Kommentare zu diesen Handbüchern

Keine Kommentare