9086/system/boot_code.asm

62 lines
685 B
NASM
Raw Normal View History

.ORG 0x84 ; INT 21
DW 0xFFFF ; Code Segment
DW PRINT_INT_HANDLE ; Program Counter
.ORG 0x0100
start:
MOV SP,#STACK
MOV AX,#0x0000
MOV CX,#0x0000
MOV BX,#0x0000
CALL TEST_
ADD CX,#0xBEEF
ADD CX,#0x4111
mov AX,#0x00FF
inc AL
mov AX,#0x00FF
inc ax
ADD AX,#0x2200
MOV SI,#0x0101
MOV [SI],AX
inc [si]
inc [si]
inc [si]
dec [si]
dec cx
cmp CX,#0x00
2023-02-24 10:08:01 +00:00
MOV CH,#0x9A
inw #0x20
CMP AL,#0xCD
2023-02-24 10:08:01 +00:00
jz WAZZ
mov al,#'0
out byte #0xA5
2023-02-24 10:08:01 +00:00
hlt
WAZZ:
CMP AH,#0xAB
jz WAZZ2
mov al,#'0
out byte #0xA5
hlt
WAZZ2:
mov al,#'1
outb #0xA5
2023-02-24 10:08:01 +00:00
hlt
TEST_:
ADD AX,#0xDEAD
RET
2023-03-14 07:20:30 +00:00
;quick&dirty
PRINT_INT_HANDLE:
push AX
MOV AL,DL
out byte #0xA5
POP AX
iret
.BLKB 10
STACK:
.ORG 0xFFF0
MOV AX,#0x0100
JMP AX