Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as Plain Text by ignacio vacca ( 15 years ago )
ORG  1000H
;MEMORIA
NUM DB 02
ROTA DB 03
RES  DB ?
;SUBRUTINAS
ORG 3000H
ROTARIZQ: PUSH BX
    MOV BX,SP
    PUSH AX
    PUSH CX
    PUSH DX
    ADD BX,6
    MOV CX,[BX]
    ADD BX,2
    MOV AX,[BX]
    CMP CX,0
    JZ FIN
ROTAR:  ADD AL,AL
  JNC SCARRY
  INC AX
SCARRY: DEC CX
  JNZ ROTAR
FIN: SUB BX,4  
  MOV DX,[BX]
  MOV BX,DX  
  MOV [BX],AL
  POP DX
  POP CX
  POP AX
  POP BX
  RET
;PROGRAMA PRINCIPAL
ORG 2000H
MOV AL,NUM
PUSH AX
MOV AL,ROTA
PUSH AX
MOV AX,OFFSET RES
PUSH AX
MOV AX,0
CALL ROTARIZQ
POP AX
POP AX
POP AX
HLT
END

 

Revise this Paste

Your Name: Code Language: