They are in no particular order. Poke around as you are inclined.
TITLE 'More Beer - By Gary Bergman'
; Z80 Assembler for OASIS-8
; http://www.castle.net/~gbergman
LD B,99
SHOW: LD DE,BEERMSG 'xx bottles of beer on the wall,'
SC 2
LD A,'.'
LD (BEERMSG+18),A place '.' after ' beer'
LD A,13
LD (BEERMSG+19),A end of message after ' beer.'
LD DE,BEERMSG
SC 2 display
LD HL,TAKEMSG
SC 2 display
LD BC,(SAVECNT)
DJNZ MORE
LD DE,NOMORE 'No more'
SC 2 display
LD DE,BEERMSG+3 'botles of beer on the wall'
SC 2
LD DE,LASTMSG
SC 2 display
SC 0 eoj
;
MORE: LD (SAVECNT),BC set new beer count
PUSH BC
POP HL
LD DE,BEERMSG 'xx bottles of beer on the wall,'
PUSH DE save beer msg address
SC 17 display number
LD A,' '
LD (DE),A set space after number
LD (BEERMSG+18),A place ' ' after ' beer'
LD A,'o'
LD (BEERMSG+19),A remove 'end message' after ' beer '
LD A,'.'
LD (WALLEND),A
POP DE 'xx bottles of beer on the wall.'
SC 2 display
LD A,','
LD (WALLEND),A
JR SHOW
;
SAVECNT: DW (0)
BEERMSG: DC '99 bottles of beer on the wall'
WALLEND: DC ',',13
TAKEMSG: DC 'Take one down, Pass it around.',13
LASTMSG: DC 'Go to the store and buy some more.',13
NOMORE: DC 'No more',0
END
; BOTTLES.ASM - 80x86 version of the bottles of beer program
cr equ 10d
lf equ 13d
cseg segment byte
assume cs:cseg, ds:cseg
org 100h
main proc
ini:
mov si, 50
lus:
mov ax, si
call int2strn
mov ah, 40h
mov bx, 1
mov cx, Bot2_Len
mov dx, offset Bot2_Msg
int 21h
mov ax, si
call int2strn
mov ah, 40h
mov bx, 1
mov cx, Bottle_Len
mov dx, offset Bottle_Msg
int 21h
mov ax, si
call int2strn
mov ah, 40h
mov bx, 1
mov cx, Pass_Len
mov dx, offset Pass_Msg
int 21h
sub si, 1
jnz lus
mov ah, 40h
mov bx, 1
mov cx, None_Len
mov dx, offset None_Msg
int 21h
mov ax, 4c00h
int 21h
main endp
int2strn proc near
mov cx,10
xor dx,dx
div cx
or al, al
jz next
push dx
mov dl,al
add dl,30h
mov ah,2
int 21h
pop dx
next:
mov ah,2
add dl,30h
int 21h
ret
int2strn endp
Bottle_Msg db ' bottles of beer on the wall, '
Bottle_Len equ $ - Bottle_Msg
Pass_Msg db ' bottles of beer. Take one down, pass it around.', cr, lf
Pass_Len equ $ - Pass_Msg
Bot2_Msg db ' bottles of beer on the wall.', cr, lf
Bot2_Len equ $ - Bot2_Msg
None_Msg db 'No more bottles of beer on the wall.', cr, lf
None_Len equ $ - None_Msg
cseg ends
end ini
; Vax VMS version of 99 Bottles of Beer
.TITLE BOTTLES
BOTT: .ASCIZ / BOTTLES OF BEER ON THE WALL,/
BOTT2: .ASCIZ / BOTTLES OF BEER, ONE DOWN, PASS IT AROUND/
BOTT3: .ASCIZ / BOTTLES OF BEER ON THE WALL./
ZERO: .LONG 48
.ENTRY START,0
MOVL #^A'9',R2
MOVL #^A'9',R3
LOOP: .TTYOUT R3
.TTYOUT R2
.PUTSTR BOTT
.TTYOUT R3
.TTYOUT R2
.PUTSTR BOTT2
CMPL R2,ZERO
BEQL DECR
CONT1: DECL R2
.TTYOUT R3
.TTYOUT R2
.PUTSTR BOTT3
CMPL R3,ZERO
BEQL CHECK
BRB LOOP
DECR: DECL R3
MOVL #^A':',R2
BRB CONT1
CHECK: CMPL R2,ZERO
BGTR LOOP
$EXIT_S
.END START
TITLE 'More Beer - By Gary Bergman'
BALR 6,0
USING *,6
OPEN PRINT
LA 5,99
SHOWBEER MVC MSGAREA(L'BEERMSG),BEERMSG
PUT PRINT,MSGAREA '...wall,'
MVC MSGAREA+18(12),=CL12'.'
PUT PRINT,MSGAREA '...wall.'
PUT PRINT,TAKEMSG 'take one'
BCT 5,MOREBEER
MVC MSGAREA(7),=C'No more'
MVC MSGAREA+7(L'BEERMSG-4),BEERMSG+4
PUT PRINT,MSGAREA
PUT PRINT,LASTMSG
CLOSE PRINT
SVC EOJ
*
MOREBEER CVD 5,DWORD set new count
MVC BEERMSG(4),=X'40202021' edit pattern
ED BEERMSG(4),DWORD+6(2) display numb
MVC MSGAREA(L'BEERMSG),BEERMSG
MVI MSGAREA+L'BEERMSG-1,C'.'
PUT PRINT,MSGAREA
MVI MSGAREA+L'BEERMSG-1,C','
B SHOWBEER
DWORD DS D
MSGAREA DC 80C' '
BEERMSG DC C' 99 bottles of beer on the wall,'
TAKEMSG DC CL80'Take one down, Pass it around.'
LASTMSG DC CL80'Go to the store and buy some more.'
# Beer on the wall program by Karl Rothamel # this progeam writes the 99 bottles of beer on the wall song # in SAL MIPS RISC assembly language .data beers: .word 99 p1: .asciiz " bottles of beer on the wall," p2: .asciiz " bottles of beer." p3: .asciiz "Take one down, pass it around," p4: .asciiz " bottles of beer on the wall." nl: .byte '\n' .text __start: loop: put beers puts p1 put nl put beers puts p2 put nl puts p3 puts nl sub beers,beers,1 put beers puts p4 put nl put nl bgtz beers,loop done
.title 99_bottles
.ident /x-1/
;+
;
; FACILITY: VMS Macro-32 version of "99 bottles of beer on the wall"
; Runs on both VAX and Alpha VMS
;
; AUTHOR: Z. Tuba
;
; CREATION DATE: March 31, 1997
;
;-
.subtitle declarations
;
; Include system macros
;
$dscdef
$ssdef
$exitdef
;
; Macros:
;
.macro init_wall
moval asc_bottles,r3
movaq b99,r6
movaq bottle_cnt,r8
movw dsc$w_length(r6),-
dsc$w_length(r8)
movc3 -
dsc$w_length(r8), -
@dsc$a_pointer(r6), -
(r3)
.endm
.macro next_bottle
decb bottle_count
movaq int_bottle_cnt, r3
movaq bottle_cnt, r4
movb bottle_count, int_bottles
movw #1, dsc$w_length(r3)
pushal dsc$w_length(r4)
pushl r4
pushl r3
calls #3, g^lib$cvt_dx_dx
.endm
.macro print row, bottle_cnt
.if nb bottle_cnt
movaq row,r7
jsb print_row
.if_false
.if nb row
pushaq row
calls #1, g^lib$put_output
.if_false
pushaq cr
calls #1, g^lib$put_output
.endc
.endc
.endm
.macro printx type=t, last=l, x
.if nb x
print 'type'_3, x
print cr
print 'type'_1, x
print 'type'_2, x
.if_false
print 'type'_3
print cr
print 'type'_1
print 'type'_2
.endc
print 'last
.endm
.macro descriptor length,pointer,dtype=t,class=s
.word length
.byte dsc$k_dtype_'dtype
.byte dsc$k_class_'class
.address pointer
.endm
;
; Local symbols
;
max_bottles = 99
max_buf = 256
max_int = 1
max_asc = 4
.sbttl ro_data - Read Only DATA
.psect ro_data rd,nowrt,noexe
;
; Descriptors
;
bottles_1: .ascid / bottles of beer on the wall,/
bottles_2: .ascid / bottles of beer,/
take_one: .ascid /Take one down and pass it around,/
bottles_3: .ascid / bottles of beer on the wall./
one_bottle_1: .ascid / bottle of beer on the wall,/
one_bottle_2: .ascid / bottle of beer,/
one_bottle_3: .ascid / bottle of beer on the wall./
no_more_1: .ascid /No more bottles of beer on the wall,/
no_more_2: .ascid /No more bottles of beer,/
no_more_3: .ascid /No more bottles of beer on the wall./
buy_more: .ascid /Go to the store and buy some more./
repeat: .ascid /99 bottles of beer on the wall .../
b99: .ascid /99/
cr: .ascid //
.sbttl rw_data - Read Write DATA
.psect rw_data rd,wrt,noexe
bottle_count: .byte max_bottles
int_bottles: .blkb max_int
int_bottle_cnt: descriptor max_int, int_bottles, b, s
asc_bottles: .blkb max_asc
bottle_cnt: descriptor max_asc, asc_bottles, t, s
out_buf: .blkb max_buf
outbuf: descriptor max_buf, out_buf, t, s
.sbttl Subroutines
.psect code rd,nowrt,exe
print_row:
.jsb_entry
moval out_buf,r3 ; Get address of output buffer
movaq outbuf,r6 ; Get output buffer descriptor
movaq bottle_cnt,r8 ; Get descriptor to the number of bottles
movzwl dsc$w_length(r8), r2 ; Calculate buffer size
addl2 dsc$w_length(r7), r2
movw r2, dsc$w_length(r6)
movc3 - ; Copy the number of bottles
dsc$w_length(r8), - ; to the output buffer
@dsc$a_pointer(r8), -
(r3)+
movc3 - ; Add the rest of the line
dsc$w_length(r7), - ; to the output buffer
@dsc$a_pointer(r7), -
(r3)
pushaq outbuf
calls #1, g^lib$put_output
rsb
.sbttl Main body of program
.entry bottles, ^m<>
init_wall
next: print bottles_1, bottle_cnt
print bottles_2, bottle_cnt
print take_one
next_bottle
cmpb bottle_count, #1
beql one
cmpb bottle_count, #0
beql last
print bottles_3, bottle_cnt
print
brb next
one: printx one_bottle, take_one, bottle_cnt
last: printx no_more, buy_more
print
print repeat
print
$exit_s r0
.end bottles