Created
April 10, 2017 00:13
-
-
Save Reflej0/432b3f3e3c970d73a9e89483eb09a445 to your computer and use it in GitHub Desktop.
Programa para contar las centenas, decenas y unidades de un numero en Assembler, en Motorola 68HC11.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Dado un numero entero sin signo de 8 bits, informar: | |
* centenas, decenas y unidades en tres posiciones de memoria | |
ORG $0000 | |
num RMB 1 * el mister en cuestion | |
cen RMB 1 | |
dec RMB 1 | |
uni RMB 1 | |
ORG $C000 | |
CLR cen * arranco poniendo todo en cero | |
CLR dec * porque voy a incrementar cada uno | |
LDAA num | |
rec SUBA #100 * intento restarle 100... | |
BLO mpc * si me pase, no hay mas centenas | |
INC cen * sino, es que habia alguna centena mas | |
BRA rec | |
mpc ADDA #100 * como me pase, le vuelvo a sumar 100 | |
red SUBA #10 * intento restarle 10... | |
BLO mpd * si me pase, no hay mas decenas | |
INC dec * sino, es que habia alguna decena mas | |
BRA red | |
mpd ADDA #10 * recupero los ultimos 10 que le reste | |
STAA uni * quedaron las unidades | |
fin BRA fin |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment