; svga.asm small model C routines for VGA graphics 12/28/88 hk
_bss segment word public 'bss'
_bss ends
_data segment word public 'data'
_data ends
dgroup group _bss,_data
_text segment byte public 'code'
assume cs: _text, ds: dgroup, ss:dgroup, es:dgroup
_text ends
_data segment word public 'data'
_hlist db 320 dup(?)
_data ends
_text segment byte public 'code'
ARG0 equ 4 ; small model parameter stack offsets
ARG1 equ 6
ARG2 equ 8
ARG3 equ 10
ARG4 equ 12
ARG5 equ 14
ARG6 equ 16
public _paint ; paint(x,y,color)
public _hl_init ; prepare for hidden lines : line(,,,,0xffff)
public _getbit ; getbit(x,y,xsize,ysize,*buffer)
public _putbit ; putbit(x,y,*buffer)
public _putlev ; putlev(x,y,level,*buffer)
public _mbutton ; mbutton(&left,&right) *int #presses
public _mmove ; mmove(&dx,&dy) *int relative moves
public _allkey ; return ascii & scode, or 0
public _key ; return ascii, or 0
public _video ; video(n)
public _ct ; ct(n,b) clear to color n, edge color b
public _vdot ; (x,y,color) for 320x200 color mode
public _vrdot ; returns color at (x,y)
public _line ; line(x1,y1,x2,y2,color)
public _vcolor
public _vpalette
public _cursor ; cursor(line,tab)
public _gpoke ; gpoke(seg,off,val)
public _gpeek ; gpeek(seg,off)
public _rnd
public _hlist
ARG0 equ 4 ; parameter stack offsets
ARG1 equ 6
ARG2 equ 8
ARG3 equ 10
ARG4 equ 12
ARG5 equ 14
XMAX equ 319
YMAX equ 199
screen dw 0a000h
delx dw ? ; variables for line()
dely dw ?
px dw ?
py dw ?
tot dw ?
tadd dw ?
gcolor dw ?
color db ?
vmode dw ? ; current video mode number
setstack macro
push bp
mov bp,sp
push si
push di
endm
getout macro
pop di
pop si
pop bp
ret
endm
coljump label word ; for 320x200 256 color mode
x = 0
rept 200
dw x
x=x+320
endm
stk dw 1000 dup(?)
_hl_init proc near
mov bx,0
mov cx,160
mov ax,0ffffh
hll: mov word ptr _hlist[bx],ax
add bx,2
loop hll
ret
_hl_init endp
_vdot proc near
setstack
push es
mov es,screen
mov bx,[bp]+ARG1 ; y line
cmp bx,0
jb vvv
cmp bx,YMAX
ja vvv
shl bx,1
mov bx,coljump[bx] ; y offset
mov ax,[bp]+ARG0 ; x offset
and ah,127 ; strip 'negative' number
cmp ax,XMAX
ja vvv
add bx,ax
mov ax,[bp]+ARG2 ; al = color
mov es:[bx],al
vvv: pop es
getout
_vdot endp
_vrdot proc near
setstack
push es
mov es,screen
mov bx,[bp]+ARG1 ; y line
shl bx,1
mov bx,coljump[bx] ; y offset
add bx,[bp]+ARG0 ; x offset
mov ax,[bp]+ARG2 ; al = color
mov al,es:[bx]
mov ah,0
pop es
getout
_vrdot endp
_gpoke proc near
setstack
push es
mov es,[bp]+ARG0
mov bx,[bp]+ARG1
mov ax,[bp]+ARG2
mov es:[bx],al
pop es
getout
_gpoke endp
_gpeek proc near
setstack
push es
mov es,[bp]+ARG0
mov bx,[bp]+ARG1
mov al,es:[bx]
mov ah,0
pop es
getout
_gpeek endp
_video proc near
setstack
mov ax,[bp]+ARG0 ; al= video mode number
mov vmode,ax
int 10h ; call BIOS to change video mode
getout
_video endp
MARK equ 0ffffh
SAVE macro value ; save value to 'stack'
mov word ptr stk[si],value
inc si
inc si
endm
LOAD macro value ; set bx to 'stack value'
dec si
dec si
mov bx,stk[si]
endm
_paint proc near
setstack
push es
mov cx,[bp]+8 ; cl = color
mov es,screen
xor si,si ; init stack index
SAVE MARK ; save 'end of list' marker
mov bx,[bp+6]
shl bx,1
mov ax,coljump[bx] ; calc initial offset of seed
add ax,[bp+4] ;x
SAVE ax ; & save on stack
ploop: LOAD ; get another line seed address
cmp bx,MARK ; did whole picture
jne pl2
pop es
getout
pl2: sub dx,dx ; up=dn=0 dh=up, dl=dn
pline: mov al,es:[bx] ; tried to paint a filled area?
or al,al
jne ploop ; yes. don't continue here
pdec: dec bx ; back up to left edge
mov al,es:[bx]
or al,al
je pdec
inc bx ; set BX to 1st open pixel on this line
chk_up: mov di,bx ; di = adr of line above
sub di,320
or dh,dh
jne up_on
up_off: cmp byte ptr es:[di],0 ; if(!up && !pix) { save(pix) up=1 }
jne chk_dn
SAVE di
inc dh
jmp short chk_dn
up_on: cmp byte ptr es:[di],0 ; if(up && pix) up=0
je chk_dn
xor dh,dh
chk_dn: mov di,bx ; di = adr of line above
add di,320
or dl,dl
jne dn_on
dn_off: cmp byte ptr es:[di],0 ; if(!dn && !pix) { save(pix) dn=1 }
jne next
SAVE di
inc dl
jmp short next
dn_on: cmp byte ptr es:[di],0 ; if(dn && pix) dn=0
je next
xor dl,dl
next: mov es:[bx],cl ; set pixel
inc bx
jmp pline
_paint endp
_ct proc near
push es
push di
mov es,screen
mov di,0
mov ax,0
cld
mov cx,32000
rep stosw
pop di
pop es
ret
_ct endp
; -------------------------------------------------------------------------
; ddot : called by line(), it places a dot at x=di, y=dx, gcolor=mode
; es = VGA segment
; save ax,cx,dx,di
_ddot proc near ; dot(di,dx,mode) uses bx
cmp di,0 ; check out of limits
jb baddot ; if dot is off screen, getout
cmp di,XMAX
ja baddot
cmp dx,0
jb baddot
cmp dx,YMAX
jna okdot
baddot: ret
okdot: push ax
mov bx,dx
shl bx,1
mov bx,coljump[bx] ; y offset
add bx,di ; x offset
mov ax,gcolor
cmp ah,255 ; hidden line?
je hidden
cmp ah,0 ; if(color>255) then use XOR
je okcol
mov al,es:[bx] ; not byte ptr es:[bx]
not al
okcol: mov es:[bx],al
okc2: pop ax
ret
hidden: cmp dl,_hlist[di] ; Y must be lower to be visible
jae okc2
mov _hlist[di],dl ; visible : update hidden list
jmp okcol
_ddot endp
;-------------------------------------------------------------------
; line(x1,y1,x2,y2,color)
;-------------------------------------------------------------------
_line proc near
setstack
mov ax,[bp]+ARG4 ; gcolor = line draw mode
mov gcolor,ax
mov di,[bp]+ARG0 ; di=xcoord x1
mov dx,[bp]+ARG1 ; dl=ycoord y1
mov ax,[bp]+ARG2 ; ax = si = abs(dx)
mov bx,[bp]+ARG3
mov px,1 ; assume positive movement
mov py,1 ; px,py = amounts to move coords.
sub ax,di
jge d1pos
neg ax
neg px ; negative x movement
d1pos: mov si,ax ; ax = si = abs(x2-x1), px = 1 or -1
sub bx,dx
jge d2pos
neg bx ; bx = dely = abs(dy), py = 1 or -1
neg py
d2pos: mov dely,bx
push es ; get screen's segment
mov es,screen
cmp ax,bx ; if deltay>deltax, then use yloop version
jl ybig
cmp ax,0 ; error trap x1==x2, y1==y2
jne xbig
call _ddot ; if just one point, then draw it & exit
jmp ldone
xbig: mov tadd,bx ; xline tadd=dely
mov cx,ax ; count=si ax=tot
xloop: call _ddot ; draw current dot
add di,px ; adjust xcoord
add ax,tadd ; add deltay to overflow register
cmp ax,si ; see of overflow > deltax
jle xgoon ; no. continue
sub ax,si ; yes. reset overflow register
add dx,py ; & adjust ycoord
xgoon: loop xloop ; loop for all xcoords
ldone: pop es
getout
ybig: mov tadd,ax ; yline tadd=si
mov ax,bx ; tot=dely (overflow register)
mov cx,bx ; count=dely ax=tot
yloop: call _ddot ; draw current dot
add dx,py ; adjust ycoord
add ax,tadd ; add deltax to overflow
cmp ax,dely ; see if overflow>deltay
jle ygoon ; no. continue
sub ax,dely ; yes. reset overflow counter
add di,px ; & adjust xcoord
ygoon: loop yloop
jmp ldone
_line endp
_vcolor proc near ; vcolor(#colors,*table (3bytes each) )
push bp
mov bp,sp
push es
push ds
pop es
mov cx,[bp]+4 ; #regs
mov dx,[bp]+6 ; table offset
mov bx,1 ; starting reg#
push dx
mov dx,3dah
mov ah,10h
vest: in al,dx
test al,8 ; wait for NOT in Vsync
jnz vest
vest2: in al,dx
test al,8 ; wait for in Vsync
jz vest2
pop dx
mov al,12h ; ah=10 al=12
int 10h
pop es
pop bp
ret
_vcolor endp
_vpalette proc near ; vpalette(*17 bytes of colors)
push bp
mov bp,sp
push es
push ds
pop es
mov dx,[bp]+4 ; offset
mov ax,1002h ; ah=10 al=2
int 10h
pop es
pop bp
ret
_vpalette endp
_allkey proc near
mov ah,1
int 16h
jz ncode ; is there a keypress ?
mov ah,0
int 16h ; yes : get it
ret
ncode: mov ax,0
ret ; if =0 then empty
_allkey endp
_key proc near
call _allkey
mov ah,0
ret
_key endp
_cursor proc near
setstack
mov cx,[bp]+ARG0 ; cl=row
mov dx,[bp]+ARG1 ; dl=col
mov dh,cl
mov ah,2
mov bh,0 ; page number
int 10h
getout
_cursor endp
rr dw ?
_rnd proc near ; rnd(max)
setstack ; rr+=inp(64)+(rr>>3); rt=rr&255;
in ax,64
add rr,ax
mov ax,rr
mov cl,3
shr ax,cl
add ax,rr
xor ah,ah
mov bx,[bp]+ARG0 ; bl = max
mov dx,127
rrl: cmp ax,bx
jb rdone
and ax,dx
shr dx,1
mov cx,ax
in al,64
cmp al,127
jle rr2
xor cx,255
mov ch,0
rr2: mov ax,cx
jmp rrl
rdone: getout
_rnd endp
_getbit proc near ; x=ARG0, y=ARG1, xs=ARG2, ys=ARG3, buf=ARG4
setstack
push es
mov ax,0a000h ; VGA segment
mov es,ax
mov di,[bp]+ARG4 ; buffer pointer
mov ax,[bp]+ARG2
mov [di],al
mov ch,al
inc di ; get sizes first
mov ax,[bp]+ARG3
mov [di],al
inc di
mov ah,ch ; ah=xsize, al=ysize
mov ch,0
mov si,[bp]+ARG1 ; y offset
shl si,1
mov si,coljump[si]
add si,[bp]+ARG0 ; di = screen offset
mov bx,si ; copy of screen offset of left edge
push ds
push ds
push es
pop ds
pop es
gb1: mov si,bx
mov cl,ah ; cx = xsize
rep movsb ; es:[di++] = ds:[si++] (cx # times)
add bx,320 ; move down 1 line
dec al
jne gb1
pop ds
pop es
getout
_getbit endp
_putbit proc near ; x=ARG0, y=ARG1, buf=ARG2
setstack
push es
mov ax,0a000h ; VGA segment
mov es,ax
mov si,[bp]+ARG2 ; buffer pointer
mov ah,[si]
inc si ; get sizes first
mov al,[si] ; ah=xsize al=ysize
inc si
mov ch,0
mov di,[bp]+ARG1 ; y offset
shl di,1
mov di,coljump[di]
add di,[bp]+ARG0 ; di = screen offset
mov bx,di ; copy of screen offset of left edge
; call vsync
gb3: mov di,bx
mov cl,ah ; cx = xsize
rep movsb ; es:[di++] = ds:[si++] (cx # times)
add bx,320 ; move down 1 line
dec al
jne gb3
pop es
getout
_putbit endp
_putlev proc near ; x=ARG0, y=ARG1, level# = ARG2, buf=ARG3
setstack
push es
mov ax,0a000h ; VGA segment
mov es,ax
mov bx,[bp]+ARG3 ; buffer pointer
mov dl,[bx]
inc bx ; get sizes first
mov cl,[bx]
inc bx
mov ch,0
mov di,[bp]+ARG1 ; y offset
shl di,1
mov di,coljump[di]
add di,[bp]+ARG0 ; di = screen offset
mov dh,dl ; dh = copy of xsize
mov si,di ; copy of screen offset of left edge
mov ax,[bp]+ARG2 ; al = level#
; call vsync
gb6: mov di,si
mov dl,dh
gb7: mov ah,[bx]
cmp ah,0
je gb8 ; always ignore 0
cmp es:[di],al ; if bkgnd>level, then go behind (don't draw)
ja gb8
mov es:[di],ah
gb8: inc bx
inc di
dec dl
jne gb7
add si,320 ; move down 1 line
loop gb6
pop es
getout
_putlev endp
vsync proc near
push dx
push ax
mov dx,3dah
vtest: in al,dx
test al,8 ; if vertical sync, go right ahead
jz vtest
pop ax
pop dx
ret
vsync endp
_mbutton proc near
setstack
mov ax,5 ; get button presses
mov bx,0 ; check button 0
int 33h
mov si,[bp]+ARG0
mov [si],bx ; stash #releases
mov ax,5
mov bx,1 ; check button 1
int 33h
mov si,[bp]+ARG1
mov [si],bx ; stash #releases
getout
_mbutton endp
_mmove proc near ; returns #mickeys of movement for x & y
setstack
mov ax,11 ; check motion counters
int 33h
mov bx,[bp]+ARG0
mov [bx],cx ; dx
mov bx,[bp]+ARG1
mov [bx],dx ; dy
getout
_mmove endp
_text ends
end
A much more important factor in the social movement than those already mentioned was the ever-increasing influence of women. This probably stood at the lowest point to which it has ever fallen, during the classic age of Greek life and thought. In the history of Thucydides, so far as it forms a connected series of events, four times only during a period of nearly seventy years does a woman cross the scene. In each instance her apparition only lasts for a moment. In three of the four instances she is a queen or a princess, and belongs either to the half-barbarous kingdoms of northern Hellas or to wholly barbarous Thrace. In the one remaining instance208— that of the woman who helps some of the trapped Thebans to make their escape from Plataea—while her deed of mercy will live for ever, her name is for ever lost.319 But no sooner did philosophy abandon physics for ethics and religion than the importance of those subjects to women was perceived, first by Socrates, and after him by Xenophon and Plato. Women are said to have attended Plato’s lectures disguised as men. Women formed part of the circle which gathered round Epicurus in his suburban retreat. Others aspired not only to learn but to teach. Arêtê, the daughter of Aristippus, handed on the Cyrenaic doctrine to her son, the younger Aristippus. Hipparchia, the wife of Crates the Cynic, earned a place among the representatives of his school. But all these were exceptions; some of them belonged to the class of Hetaerae; and philosophy, although it might address itself to them, remained unaffected by their influence. The case was widely different in Rome, where women were far more highly honoured than in Greece;320 and even if the prominent part assigned to them in the legendary history of the city be a proof, among others, of its untrustworthiness, still that such stories should be thought worth inventing and preserving is an indirect proof of the extent to which feminine influence prevailed. With the loss of political liberty, their importance, as always happens at such a conjuncture, was considerably increased. Under a personal government there is far more scope for intrigue than where law is king; and as intriguers women are at least the209 equals of men. Moreover, they profited fully by the levelling tendencies of the age. One great service of the imperial jurisconsults was to remove some of the disabilities under which women formerly suffered. According to the old law, they were placed under male guardianship through their whole life, but this restraint was first reduced to a legal fiction by compelling the guardian to do what they wished, and at last it was entirely abolished. Their powers both of inheritance and bequest were extended; they frequently possessed immense wealth; and their wealth was sometimes expended for purposes of public munificence. Their social freedom seems to have been unlimited, and they formed combinations among themselves which probably served to increase their general influence.321 The old religions of Greece and Italy were essentially oracular. While inculcating the existence of supernatural beings, and prescribing the modes according to which such beings were to be worshipped, they paid most attention to the interpretation of the signs by which either future events in general, or the consequences of particular actions, were supposed to be divinely revealed. Of these intimations, some were given to the whole world, so that he who ran might read, others were reserved for certain favoured localities, and only communicated through the appointed ministers of the god. The Delphic oracle in particular enjoyed an enormous reputation both among Greeks and barbarians for guidance afforded under the latter conditions; and during a considerable period it may even be said to have directed the course of Hellenic civilisation. It was also under this form that supernatural religion suffered most injury from the great intellectual movement which followed the Persian wars. Men who had learned to study the constant sequences of Nature for themselves, and to shape their conduct according to fixed principles of prudence or of justice, either thought it irreverent to trouble the god about questions on which they were competent to form an opinion for themselves, or did not choose to place a well-considered scheme at the mercy of his possibly interested responses. That such a revolution occurred about the middle of the fifth century B.C., seems proved by the great change of tone in reference to this subject which one perceives on passing from Aeschylus to Sophocles. That anyone should question the veracity of an oracle is a supposition which never crosses the mind of the elder dramatist. A knowledge of augury counts among the greatest benefits222 conferred by Prometheus on mankind, and the Titan brings Zeus himself to terms by his acquaintance with the secrets of destiny. Sophocles, on the other hand, evidently has to deal with a sceptical generation, despising prophecies and needing to be warned of the fearful consequences brought about by neglecting their injunctions. The stranger had a pleasant, round face, with eyes that twinkled in spite of the creases around them that showed worry. No wonder he was worried, Sandy thought: having deserted the craft they had foiled in its attempt to get the gems, the man had returned from some short foray to discover his craft replaced by another. “Thanks,” Dick retorted, without smiling. When they reached him, in the dying glow of the flashlight Dick trained on a body lying in a heap, they identified the man who had been warned by his gypsy fortune teller to “look out for a hidden enemy.” He was lying at full length in the mould and leaves. "But that is sport," she answered carelessly. On the retirement of Townshend, Walpole reigned supreme and without a rival in the Cabinet. Henry Pelham was made Secretary at War; Compton Earl of Wilmington Privy Seal. He left foreign affairs chiefly to Stanhope, now Lord Harrington, and to the Duke of Newcastle, impressing on them by all means to avoid quarrels with foreign Powers, and maintain the blessings of peace. With all the faults of Walpole, this was the praise of his political system, which system, on the meeting of Parliament in the spring of 1731, was violently attacked by Wyndham and Pulteney, on the plea that we were making ruinous treaties, and sacrificing British interests, in order to benefit Hanover, the eternal millstone round the neck of England. Pulteney and Bolingbroke carried the same attack into the pages of The Craftsman, but they failed to move Walpole, or to shake his power. The English Government, instead of treating Wilkes with a dignified indifference, was weak enough to show how deeply it was touched by him, dismissed him from his commission of Colonel of the Buckinghamshire Militia, and treated Lord Temple as an abettor of his, by depriving him of the Lord-Lieutenancy of the same county, and striking his name from the list of Privy Councillors, giving the Lord-Lieutenancy to Dashwood, now Lord Le Despencer. "I tell you what I'll do," said the Deacon, after a little consideration. "I feel as if both Si and you kin stand a little more'n you had yesterday. I'll cook two to-day. We'll send a big cupful over to Capt. McGillicuddy. That'll leave us two for to-morrer. After that we'll have to trust to Providence." "Indeed you won't," said the Surgeon decisively. "You'll go straight home, and stay there until you are well. You won't be fit for duty for at least a month yet, if then. If you went out into camp now you would have a relapse, and be dead inside of a week. The country between here and Chattanooga is dotted with the graves of men who have been sent back to the front too soon." "Adone do wud that—though you sound more as if you wur in a black temper wud me than as if you pitied me." "Wot about this gal he's married?" "Don't come any further." "Davy, it 'ud be cruel of us to go and leave him." "Insolent priest!" interrupted De Boteler, "do you dare to justify what you have done? Now, by my faith, if you had with proper humility acknowledged your fault and sued for pardon—pardon you should have had. But now, you leave this castle instantly. I will teach you that De Boteler will yet be master of his own house, and his own vassals. And here I swear (and the baron of Sudley uttered an imprecation) that, for your meddling knavery, no priest or monk shall ever again abide here. If the varlets want to shrieve, they can go to the Abbey; and if they want to hear mass, a priest can come from Winchcombe. But never shall another of your meddling fraternity abide at Sudley while Roland de Boteler is its lord." "My lord," said Edith, in her defence, "this woman has sworn falsely. The medicine I gave was a sovereign remedy, if given as I ordered. Ten drops would have saved the child's life; but the contents of the phial destroyed it. The words I uttered were prayers for the life of the child. My children, and all who know me, can bear witness that I have a custom of asking His blessing upon all I take in hand. I raised my eyes towards heaven, and muttered words; but, my lord, they were words of prayer—and I looked up as I prayed, to the footstool of the Lord. But it is in vain to contend: the malice of the wicked will triumph, and Edith Holgrave, who even in thought never harmed one of God's creatures, must be sacrificed to cover the guilt, or hide the thoughtlessness of another." "Aye, Sir Treasurer, thou hast reason to sink thy head! Thy odious poll-tax has mingled vengeance—nay, blood—with the cry of the bond." HoME古一级毛片免费观看
ENTER NUMBET 0017
bibi5.com.cn
fente8.net.cn
sheru2.net.cn
www.gdic.net.cn
laoer1.net.cn
jiuqu6.net.cn
tuyan3.com.cn
www.tafan4.net.cn
www.xinye3.com.cn
rizao0.net.cn