3 ; Copyright 1995-1997 Werner Almesberger
4 ; Copyright 2009-2011 Joachim Wiedorn
7 ; Licensed under the terms contained in the file 'COPYING'
8 ; in the source directory.
20 _main: push sp ! push all registers
33 mov ax,#BOOTSEG ! let DS point to where we really are
35 mov bx,#msgs ! set up loop
36 l: call say ! output message
37 cmp byte ptr (bx),#0 ! at end ?
38 je back ! yes -> back to LILO
39 pop ax ! get next data word
41 call wout ! output data word
46 back: mov ax,#FIRSTSEG
48 mov word ptr (CODE_START_1),#CODE_START_1+8
49 mov word ptr (CODE_START_1+2),#FIRSTSEG
50 mov word ptr (CODE_START_1+4),#CODE_START_1+12
51 mov byte ptr (CODE_START_1+6),#0xfe
52 mov es,ax ! adjust segments
55 mov word ptr (10),#0xffff ! no timeout
56 mov si,#haltnow ! copy string data
57 mov di,#CODE_START_1+8
61 mov ax,#FIRSTSEG ! restart LILO
68 ! Display a NUL-terminated string on the console
70 say: mov al,(bx) ! get byte
74 push bx ! save pointer
75 mov ah,#14 ! display, tty-style
81 wout: push ax ! display one word
85 bout: push ax ! display one byte
89 nout: and al,#15 ! display one nibble
94 nokay: xor bh,bh ! display on screen
100 .ascii "Register dump:"
129 .ascii "Restarting LILO ..."
131 .ascii "System halted."
135 haltnow:.ascii "LILO" ! prevent automatic reboot