a2: bearbeitet während Praktikum

This commit is contained in:
Johannes Theiner 2018-10-25 11:26:51 +02:00
parent 44a382990b
commit c96245788f
1 changed files with 29 additions and 5 deletions

View File

@ -18,15 +18,39 @@
;E=01111001=79 ;E=01111001=79
;F=01110001=71 ;F=01110001=71
INPUT equ 0h
LED equ 0h
SEGM equ 90h
; 0 1 2 3 4 5 6 7 8 9 A B C D E F ; 0 1 2 3 4 5 6 7 8 9 A B C D E F
SEG db 0x3F, 0x6, 0x5B, 0x4F, 0x66, 0x6D, 0x7D, 0x7, 0x7F, 0x6F, 0x77, 0xFF, 0x39, 0xBF, 0x79, 0x71 segtext db 0x3F, 0x6, 0x5B, 0x4F, 0x66, 0x6D, 0x7D, 0x7, 0x7F, 0x6F, 0x77, 0xFF, 0x39, 0xBF, 0x79, 0x71
res db 0x0
jmp WDH jmp WDH
WDH: in ax, INPUT
mov res, ax
and ax, 00001111b;get second nibble
out LED, ax;debug, output to leds
push ax;write result to stack
WDH: in ax, 0
out 90h, ax mov ax, res
out 0, ax mov cl, 4
shr ax, cl;shift right 4 times
and ax, 00001111b;might not be needed
out LED, ax;debug, output to leds
push ax;write result to stack
pop ax;get from stack
pop bx;get from stack
sub ax, bx
out LED, ax;output to led
out SEGM, al;output to seven segment display
jmp WDH jmp WDH