diff --git a/src/a0.1.add.asm b/src/asm/a0.1.add.asm similarity index 100% rename from src/a0.1.add.asm rename to src/asm/a0.1.add.asm diff --git a/src/a0.1.sub.asm b/src/asm/a0.1.sub.asm similarity index 100% rename from src/a0.1.sub.asm rename to src/asm/a0.1.sub.asm diff --git a/src/a0.2.and.asm b/src/asm/a0.2.and.asm similarity index 100% rename from src/a0.2.and.asm rename to src/asm/a0.2.and.asm diff --git a/src/a0.2.or.asm b/src/asm/a0.2.or.asm similarity index 100% rename from src/a0.2.or.asm rename to src/asm/a0.2.or.asm diff --git a/src/a0.3.add.asm b/src/asm/a0.3.add.asm similarity index 100% rename from src/a0.3.add.asm rename to src/asm/a0.3.add.asm diff --git a/src/a0.3.xor.asm b/src/asm/a0.3.xor.asm similarity index 100% rename from src/a0.3.xor.asm rename to src/asm/a0.3.xor.asm diff --git a/src/a1.asm b/src/asm/a1.asm similarity index 100% rename from src/a1.asm rename to src/asm/a1.asm diff --git a/src/a2.asm b/src/asm/a2.asm similarity index 67% rename from src/a2.asm rename to src/asm/a2.asm index 591a389..810d592 100644 --- a/src/a2.asm +++ b/src/asm/a2.asm @@ -25,32 +25,50 @@ SEGM equ 90h ; 0 1 2 3 4 5 6 7 8 9 A B C D E F segtext db 0x3F, 0x6, 0x5B, 0x4F, 0x66, 0x6D, 0x7D, 0x7, 0x7F, 0x6F, 0x77, 0xFF, 0x39, 0xBF, 0x79, 0x71 -res db 0x0 jmp WDH WDH: in ax, INPUT - mov res, [ax] + + mov bx, ax and ax, 00001111b;get second nibble - out LED, ax;debug, output to leds + ;out LED, ax;debug, output to leds push ax;write result to stack - mov ax, [res] + mov ax, bx mov cl, 0x4 - sar ax, cl;shift right 4 times - ;and ax, 00001111b; - out LED, ax;debug, output to leds - push ax;write result to stack + shr ax, cl;shift right 4 times - - pop ax;get from stack + ;out LED, ax;debug, output to leds pop bx;get from stack sub ax, bx out LED, ax;output to led + ;right seven segment display + push ax + mov bx, segtext + and ax, 0000000000001111b + add bx, ax + + mov al, [bx] + out SEGM, al;output to seven segment display + + ;left seven segment display + pop ax;get from stack + mov cl, 0x4 + shr ax, cl + mov bx, segtext + add bx, ax + + mov al, [bx] + out SEGM + 0x2, al + + jmp WDH + +