home *** CD-ROM | disk | FTP | other *** search
- page ,132 ;buy wide paper. All real computers use wide paper.
- name yes ;yes, we have a name, but it's secret.
- ;
- ;****************************************
- ;* *
- ;* Good Programming Practice *
- ;* and proper use of long *
- ;* variable names. *
- ;* *
- ;* *
- ;* created T. Jennings 32 June -82 *
- ;* edit errors 17 Oct. 92 *
- ;* *
- ;* *
- ;****************************************
- ;
- ;Cause the machine to enter a very stable and
- ;safe state where no harm can be done to precious
- ;disk files.
- ;
- a_long_arbitrary_name segment byte 'code'
- assume cs:a_long_arbitrary_name,ds:a_long_arbitrary_name
-
- cpm equ 0 ;now, it's not that bad,
- msdos equ $ ;that's what the fuss's over,
-
- one_hundred_hex_or_two_fifty_six_decimal equ 100h
- nine equ 1001b
- carriage_return equ 0dh ;carriage??
- sicks equ 6
- line_feed equ 0ah
- four equ '4'
- dollar_sign_instead_of_more_sensible_zero equ '$'
-
- if cpm ;if it even smells like CP/M,
- diddy wah diddy ;generate cryptic error messages,
- call call ;after all, this is a real system now.
- endif
- org one_hundred_hex_or_two_fifty_six_decimal
-
- this_is_the_start_of_the_program:
- mov ax,cs ;Set all the wonderful segment
- mov ds,ax ;registers. A processor with so
- mov ss,ax ;many is obviously superior to
- mov es,ax ;any other.
- mov sp,offset after_a_block_of_dws ;Smash Pointer now harmless.
- mov bp,'eh' ;Important constant.
-
- mov dx,offset a_message_for_the_fool_who_runs_this_program
- call print_an_ascii_string_pointed_to_by_the_dx_register
-
- cli ;interrupts too complicated.
- lock hlt ;Nirvana.
-
- ;
- ;Print an ascii string pointed to by DX on the TTY. (What?) If a message does
- ;not appear, you probably ran it on your ZX-81. Try changing memory cards,
- ;or face south and say, "IBM".
- ;
- print_an_ascii_string_pointed_to_by_dx:
- mov bx,dx ;Priesthood requires random
- here_is_where_we_loop: ;register changes to confuse
- mov al,[bx] ;neophytes,
- cmp al,dollar_sign_instead_of_more_sensible_zero
- je were_done_typing_the_string
- add bx,bp
- sub bx,'eg' ;this helps, too.
- call type_the_contents_of_al_on_the_system_console
- jmp here_is_where_we_loop
- were_done_typing_the_string:
- ret
- ;
- ;Type the contents of al on the system console.
- ;
- type_the_contents_of_al_on_the_system_console:
- mov dl,al ;look! self documenting code!
- mov ah,sicks
- int '!'
- ret
-
- a_message_for_the_fool_who_runs_this_program label byte
- db carriage_return,line_feed
- db "Now you dun it."
- db dollar_sign_instead_of_more_sensible_zero
-
- dw one_hundred_hex_or_two_fifty_six_decimal dup (?)
-
- after_a_block_of_dws label word
-
- a_long_arbitrary_name ends; here
-
- end;, thank god.
- _or_two_fifty_six_decimal dup (?)
-
- after_a_block_of_dws label word
-
- a_long_arbitrary_name ends; here
-
- end;, thank god.
- _or_two_fifty_six_decimal dup (?)
-
- after_a_block_of_dws label word
-
- a