wok-tiny view tfttest/stuff/bootloader.S @ rev 172

Add x86test & tfttest
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat May 08 17:23:19 2021 +0000 (2021-05-08)
parents
children eb617e43dc08
line source
1 .text
2 .code16
3 .arch i8086
4 .org 0
5 .globl _start
6 _start:
7 call start2
8 start2:
9 popw %bx
10 cmpb $0x1, %bh
11 je dotcom
12 xorw %ax, %ax # %ax = 0
13 movw %ax, %ds
14 leaw int21-start2(%bx), %ax
15 movw %ax,0x21*4
16 movw %cs,0x21*4+2
17 movw $0x7C0-0x10, %ax
18 movw %ax, %ds
19 dotcom:
20 movw %ds, %ax
21 addw $6, %ax # addw $code/16, %ax
22 movw %ax, %ds
23 movw %ax, %es
24 movw %ax, %ss
25 movw $0xFFFE, %sp
26 pushw %ds
27 movw $0x100, %ax
28 pushw %ax
29 cbw
30 xorw %bx, %bx
31 retf
33 int21:
34 cmpb $7, %ah
35 jne not_input
36 movb $0, %ah
37 int $0x16
38 do_iret:
39 iret
40 not_input:
41 cmpb $9, %ah
42 jne abort
43 movw %dx, %si
44 puts:
45 lodsb
46 cmpb $'$', %al
47 je do_iret
48 movb $0xe, %ah
49 movw $0xf, %bx
50 int $0x10
51 jmp puts
52 abort:
53 ljmp $0xffff,$0
55 .org 0x60
56 code:
57 .org 510
59 .word 0xaa55