1 /* dump.S - LILO register dumper */
3 Copyright 1995-1997 Werner Almesberger.
6 Licensed under the terms contained in the file 'COPYING' in the
21 _main: push sp ! push all registers
34 mov ax,#BOOTSEG ! let DS point to where we really are
36 mov bx,#msgs ! set up loop
37 l: call say ! output message
38 cmp byte ptr (bx),#0 ! at end ?
39 je back ! yes -> back to LILO
40 pop ax ! get next data word
42 call wout ! output data word
47 back: mov ax,#FIRSTSEG
49 mov word ptr (CODE_START_1),#CODE_START_1+8
50 mov word ptr (CODE_START_1+2),#FIRSTSEG
51 mov word ptr (CODE_START_1+4),#CODE_START_1+12
52 mov byte ptr (CODE_START_1+6),#0xfe
53 mov es,ax ! adjust segments
56 mov word ptr (10),#0xffff ! no timeout
57 mov si,#haltnow ! copy string data
58 mov di,#CODE_START_1+8
62 mov ax,#FIRSTSEG ! restart LILO
69 ! Display a NUL-terminated string on the console
71 say: mov al,(bx) ! get byte
75 push bx ! save pointer
76 mov ah,#14 ! display, tty-style
82 wout: push ax ! display one word
86 bout: push ax ! display one byte
90 nout: and al,#15 ! display one nibble
95 nokay: xor bh,bh ! display on screen
101 .ascii "Register dump:"
130 .ascii "Restarting LILO ..."
132 .ascii "System halted."
136 haltnow:.ascii "LILO" ! prevent automatic reboot