flat assembler
Message board for the users of flat assembler.
Index
> Tutorials and Examples > jmp loop until int 16h 8086 |
Author |
|
Picnic 06 Feb 2020, 08:26
Hi connor,
My 16-bit code is a bit rusty. However I wrote this for you. I've tried it on Emu8086 and Windows XP. It's a com file so it won't run on 64-bit Windows without DosBox. Code: org 100h _loop: ; check for a keystroke mov ah,1 int 16h jz _loop ; a keystroke is present ; remove it from the keyboard buffer xor ah,ah int 16h ; AH = BIOS scan code ; AL = ASCII character ; check for ESC cmp al,27 jne _loop ret |
|||
06 Feb 2020, 08:26 |
|
connor 07 Feb 2020, 04:59
;face palm
thank you what if i wanted to add other keys to do other stuff and what about placing text onto a specific location and what about boot straps, what about proctection and long mode and nine million and nine other basic things i cant find a straignt answer for _________________ cars tech weed bitches country & thug life |
|||
07 Feb 2020, 04:59 |
|
Picnic 07 Feb 2020, 10:07
Quote: what if i wanted to add other keys to do other stuff A small extension to the code. Code: org 100h _loop: ; check for a keystroke mov ah,1 int 16h jz .C ; a keystroke is present ; remove it from the keyboard buffer xor ah,ah int 16h ; AH = BIOS scan code ; AL = ASCII character ; check for ESC cmp al,27 je .E ; check for A,D,W,S cmp al,'A' je .A cmp al,'D' je .D cmp al,'W' je .W cmp al,'S' je .S jmp .C .A: ; do something jmp .C .D: ; do something jmp .C .W: ; do something jmp .C .S: ; do something jmp .C ; code .C: ; code jmp _loop .E: ret Quote: and what about placing text onto a specific location This code taken from the Emu8086 documentation. Remove 'offset' if you compile with fasm. Code: org 100h ; INT 10h / AH = 2 - set cursor position. ; input: ; DH = row. ; DL = column. ; BH = page number (0..7). mov dh, 10 mov dl, 20 mov bh, 0 mov ah, 2 int 10h ; INT 21h / AH=9 - output of a string at DS:DX. String must be terminated by '$'. mov dx, offset msg mov ah, 9 int 21h ret msg db "hello world $" Hope this helped. |
|||
07 Feb 2020, 10:07 |
|
connor 08 Feb 2020, 04:24
at least it sets me in the right direction
much better than anything else assembly i understand easy verilog and vhdl, what are they smoking with tat sheat _________________ cars tech weed bitches country & thug life |
|||
08 Feb 2020, 04:24 |
|
connor 09 Feb 2020, 16:34
let me bug you one more time,
what about the PC speaker and the sound blaster input and out put? _________________ cars tech weed bitches country & thug life |
|||
09 Feb 2020, 16:34 |
|
Picnic 10 Feb 2020, 08:16
Try searching the forum. A quick search for "PC SPEAKER" gave me some results. The same goes for sound blaster (i guess).
https://board.flatassembler.net/topic.php?t=2432 https://board.flatassembler.net/topic.php?t=14049 https://board.flatassembler.net/topic.php?t=15222 |
|||
10 Feb 2020, 08:16 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.