Hello.
I am an old clipper programmer. I am in the process of recompiling some of my programs we still use today on a Novell server.
I use to write functions in assembler for some of the functions clipper did not have. A typical assembler listing is below.
Is it possible to use pelles C (or any other C/C#/C++ compiler) to create a .LIB file I can link using xharbour (32 bit, clipper was 16 bit)
Could someone give me a 1,2,3 list of the steps and tools i need to use?
I still program microcontrollers in assembler but I have fiinally grasped the C language and now use C for most of my microcontroller programming. For my clipper programs I am converting, I still will not be using the new GUI type interfaces as xharbour is 100% compatible with the old clipper code and compiles the code for console.
typical old assembler listing
=====================
.MODEL LARGE
INCLUDE C:\EXTASM.INC
PUBLIC SHADEBOX
.DATA
LTOPD DB 201D
RTOPD DB 187D
LBOTD DB 200D
RBOTD DB 188D
HORZD DB 205D
VERTD DB 186D
LTOP DB 218D
RTOP DB 191D
LBOT DB 192D
RBOT DB 217D
HORZ DB 196D
VERT DB 179D
dispage db 0h
attbyte db 0h
shadow db 00001000b
tboxrow db 0h
bboxrow db 0h
lboxcol db 0h
rboxcol db 0h
vcount db 0h
hcount db 0h
vcount1 db 0h
hcount1 db 0h
row db 0h
col db 0h
.CODE
shadebox PROC FAR
PUSH SI
PUSH AX
PUSH BX
PUSH CX
PUSH DX
PUSH BP
MOV BP,SP
PUSH DS
PUSH SI
PUSH DI
mov ax,1
push ax
call __parinfo ; get parm1
add sp,2
test ax, NUMERIC ;is it numeric
jz shadebye ;no - return
mov ax,2
push ax
call __parinfo
add sp,2
test ax, NUMERIC
jz shadebye
mov ax,3
push ax
call __parinfo
add sp,2
test ax, NUMERIC
jz shadebye
mov ax,4
push ax
call __parinfo
add sp,2
test ax, NUMERIC
jz shadebye
mov ax,5
push ax
call __parinfo
add sp,2
test ax, NUMERIC
jz shadebye
jnz shadeok
shadebye:
jmp shadex
shadeok:
mov ax,1
push ax
call __parni
add sp,2
mov [tboxrow],al
mov ax,2
push ax
call __parni
add sp,2
mov [lboxcol],al
mov ax,3
push ax
call __parni
add sp,2
mov [bboxrow],al
sub al,[tboxrow]
dec al
mov [vcount],al
mov ax,4
push ax
call __parni
add sp,2
mov [rboxcol],al
sub al,[lboxcol]
mov [hcount],al
mov ax,6
push ax
call __parni
add sp,2
mov cl,04h
shl al,cl
mov [attbyte],al
mov ax,5
push ax
call __parni
add sp,2
or [attbyte],al
mov ah,02h ;set cursor top left of box
mov bh,0h
mov dh,[tboxrow]
mov [row],dh
mov dl,[lboxcol]
mov [col],dl
int 10h
mov ah,09h ; draw horizontal line
mov al,[horzd]
mov bh,0h
mov bl,[attbyte]
mov ch,0h
mov cl,[hcount]
int 10h
mov ah,09h
mov al,[ltopd] ; draw top left corner
mov bh,0h
mov bl,[attbyte]
mov cx,01h
int 10h
mov al,[vcount]
mov [vcount1],al
vlp1:
mov ah,02h ; move cursor down 1 row
mov bh,0h
inc [row]
mov dh,[row]
mov dl,[col]
int 10h
mov ah,09h ; output vertical line
mov al,[vertd]
mov bh,0h
mov bl,[attbyte]
mov cx,01h
int 10h
dec [vcount1]
jne vlp1
mov ah,02h ;set cursor bottom left of box
mov bh,0h
mov dh,[bboxrow]
mov [row],dh
mov dl,[lboxcol]
mov [col],dl
int 10h
mov ah,09h ; draw horizontal line
mov al,[horzd]
mov bh,0h
mov bl,[attbyte]
mov ch,0h
mov cl,[hcount]
int 10h
mov ah,09h
mov al,[lbotd] ; draw bottom left corner
mov bh,0h
mov bl,[attbyte]
mov cx,01h
int 10h
mov ah,02h ;set cursor top right of box
mov bh,0h
mov dh,[tboxrow]
mov [row],dh
mov dl,[rboxcol]
mov [col],dl
int 10h
mov ah,09h ; draw top right corner
mov al,[rtopd]
mov bh,0h
mov bl,[attbyte]
mov cx,01h
int 10h
mov al,[vcount]
mov [vcount1],al
vlp2:
mov ah,02h ; move cursor down 1 row
mov bh,0h
inc [row]
mov dh,[row]
mov dl,[col]
int 10h
mov ah,09h ; output vertical line
mov al,[vertd]
mov bh,0h
mov bl,[attbyte]
mov cx,01h
int 10h
dec [vcount1]
jne vlp2
mov ah,02h ;set cursor bottom right of
box
mov bh,0h
mov dh,[bboxrow]
mov dl,[rboxcol]
int 10h
mov ah,09h ; draw bottom right corner
mov al,[rbotd]
mov bh,0h
mov bl,[attbyte]
mov cx,01h
int 10h
;get bottom row+1 , left col+1 in pointers
mov dh,[bboxrow]
inc dh
mov [row],dh
cmp dh,24d
ja nohshade
mov dl,[lboxcol]
inc dl
mov [col],dl
mov al,[hcount]
mov [hcount1],al
hshade:
mov ah,02 ; position cursor
mov bh,0h
mov dh,[row]
mov dl,[col]
int 10h
mov ah,08h ; read character and attribute
mov bh,0h
int 10h
mov bl,[shadow] ; reprint it with shadow
attribute
mov ah,09h
mov bh,0h
mov cx,01h
int 10h
inc [col]
dec [hcount1]
jne hshade
nohshade:
; get top right row+1 , top right col+1
mov dh,[tboxrow]
inc dh
mov [row],dh
mov dl,[rboxcol]
inc dl
mov [col],dl
mov al,[vcount]
inc al
inc al
mov [vcount1],al
vshade:
mov ah,02 ; position cursor
mov bh,0h
mov dh,[row]
mov dl,[col]
cmp dl,79d
ja noshade
int 10h
mov ah,08h ; read character and attribute
mov bh,0h
int 10h
mov bl,[shadow] ; reprint it with shadow
attribute
mov ah,09h
mov bh,0h
mov cx,01h
int 10h
inc [row]
dec [vcount1]
jne vshade
; get top right row+1 , top right col+2
mov dh,[tboxrow]
inc dh
mov [row],dh
mov dl,[rboxcol]
inc dl
inc dl
mov [col],dl
mov al,[vcount]
inc al
inc al
mov [vcount1],al
noshade:
jmp noshade1
vshade2:
mov ah,02 ; position cursor
mov bh,0h
mov dh,[row]
mov dl,[col]
cmp dl,79d
ja noshade
int 10h
mov ah,08h ; read character and attribute
mov bh,0h
int 10h
mov bl,[shadow] ; reprint it with shadow
attribute
mov ah,09h
mov bh,0h
mov cx,01h
int 10h
inc [row]
dec [vcount1]
jne vshade2
noshade1:
; get top row+1 , top left col+1
mov dh,[tboxrow]
inc dh
mov [row],dh
mov dl,[lboxcol]
inc dl
mov [col],dl
mov al,[vcount]
mov [vcount1],al
dec [hcount]
je shadex
fillbox:
mov ah,02 ; position cursor
mov bh,0h
mov dh,[row]
mov dl,[col]
int 10h
mov ah,09h ; fill horizontal line
mov al,32d
mov bh,0h
mov bl,[attbyte]
mov ch,0h
mov cl,[hcount]
int 10h
inc [row]
dec [vcount1]
jne fillbox
SHADEX:
POP DI
POP SI
POP DS
POP BP
POP DX
POP CX
POP BX
POP AX
POP SI
RET
shadebox ENDP
END