размер блока в зависимости от размера экрана
28.05.2024

делаем чтобы изменялся размер блока в зависимости от размера экрана

@media (max-width: 700px) 
{
	.nav a .button1 { height: 60px; margin: 3px; width: 140px; }
    .search_body { width: 100%; }
}

@media (max-width: 350px) 
{
    .nav a .button1 { height: 45px; margin: 3px; width: 110px; }
    .search_body { width: 100%; }
}

 

1  11.06.2024 10:15
#include "p18f26k22.inc"
#include "p18macros.inc"

	org 0000
;	goto itoa1


itoa1:

#define Integer  10
#define IntegerH 11

#define f 1
#define w 0
;Counter	    equ	    0x20 

#define Buffer   20

intAdr	equ 0x70		
BCDAdr	equ 0x110
intL	equ 0xfa
intH	equ 0x80
;Result  equ 0x100

; B
long1	equ 0xfe;0xa5
long2	equ 0x00;0xff
; A
long3	equ 0xff
long4	equ 0x00


long5	equ	0x35
long6	equ	0x16
long7	equ	0x23
long8	equ	0x7f

Temp1	equ	0x15
Temp2	equ	0x16

Result	equ 0x0
Result1 equ 0x1


;       itoBCD function
;       FSR0 - pointer to result BCD
;               
; https://stackoverflow.com/questions/1408361/unsigned-integer-to-bcd-conversion
; Negative values
; https://pro-prof.com/forums/topic/asm_i8086_6
neglong

	clrf	Result
	clrf	Result+1
	clrf	BSR

	lfsr	FSR1,intAdr
    movlw	long1
	movwf	POSTINC1
    movlw	long2
	movwf	POSTINC1	
    movlw	long3
	movwf	POSTINC1
    movlw	long4
	movwf	POSTINC1
    movlw	long5
	movwf	POSTINC1
    movlw	long6
	movwf	POSTINC1
    movlw	long7
	movwf	POSTINC1
    movlw	long8
	movwf	POSTINC1

	movff	intAdr,Temp1
	movff	intAdr+1,Temp2

	lfsr	FSR1,intAdr
	lfsr	FSR0,intAdr+2 ; integer
	lfsr	FSR2,Result ; Result


; bnc -	A <= B  C = 1	Z = 1
; bc  -	A < B   C = 1	Z = 0
; if  - A > B 	C = 0   Z = 0
; if  - A > B 	C = 0	Z = 1
	movf	intAdr,w
	subwf	intAdr+2,w
	movf	intAdr+1,w
	subwfb	intAdr+3,w


	movf	intAdr+1,w
	xorwf	intAdr+2+1,w
	bnz		_2_bytes_Equel_end
	movf	intAdr+2,w
	xorwf	intAdr,w
_2_bytes_Equel_end:

;AA 	equ 0x70
;B 	equ 0x74

#define	TempStorage Result
#define Quotient Result
#define	Dividend intAdr+4
#define	Divisor intAdr
#define Remainder TempStorage+4
#define Counter Remainder+4

	clrf	Quotient+3    
	clrf	Quotient+2
	clrf 	Quotient+1
    clrf 	Quotient
	clrf	Remainder+3
	clrf	Remainder+2
	clrf	Remainder+1
	clrf	Remainder

;check Denominator - Divisor for Zeros in two upper bytes ( for example 00 00 12 fe )
; if two upper bytes are 0 , then call 4bytes/2 bytes algo
	movlw	0
	cpfseq	Divisor+3,f			; 0x00 22 33 44 ?  3 bytes
	bra		Divide_4_on_4_Try
	cpfseq	Divisor+2,f			; 0x00 00 33 44 ?  2 bytes
	bra		_4_div_3
	cpfseq	Divisor+1,f			; 0x00 00 00 44 ?  1 byte
	bra		_4_div_2
	cpfseq	Divisor,f			; 0x00 00 00 00 ?  quit
	bra		_4_div_1
	retlw	-1

Divide_4_on_4_Try:

	movf	Divisor+3,w
	cpfsgt	Dividend+3,f		; checking if Divisor > Dividend
	retlw	0					; Division DONE

Divide_4_on_4_Start:
	movf	Divisor,w
	subwf	Dividend,f
	movf	Divisor+1,w
	subwfb	Dividend+1,f
	movf	Divisor+2,w
	subwfb	Dividend+2,f
	movf	Divisor+3,w
	subwfb	Dividend+3,f
;	retlw	0 or Correct_Remainder	; Division DONE      
	bnc		Correct_Remainder		; Division DONE
	call	Quotient_increase
	bra		Divide_4_on_4_Start

Quotient_increase:
	movlw	0x0
	incf	Quotient,f
	addwfc	Quotient+1,f
	addwfc	Quotient+2,f
	addwfc	Quotient+3,f
	return

Correct_Remainder:
	movf	Divisor,w
	addwf	Dividend,f
	movf	Divisor+1,w
	addwfc	Dividend+1,f
	movf	Divisor+2,w
	addwfc	Dividend+2,f
	movf	Divisor+3,w
	addwfc	Dividend+3,f
	retlw	0					; Division DONE


; 1111111111111111111111111111111111111111111111111111111111111111111
_4_div_1:
	movff	Dividend+3,Remainder
	movff	Dividend+2,Dividend+3
	movff	Dividend+1,Dividend+2
	movff	Dividend,Dividend+1	
	clrf	Dividend
	
	movlw	.24
	movwf	Counter

Begin_Div_RLF_4_1:
	call	Shift_all
	call	check_div_pos_4_1			; checking if devide possible

	decfsz	Counter,f
	bra		Begin_Div_RLF_4_1
	return

check_div_pos_4_1:
	movf	Divisor,w
	subwf	Remainder,f
	bnc		Fix_Sub_4_1	
Continue_div_4_1:
	call	Quotient_increase
	bra		check_div_pos_4_1

Fix_Sub_4_1:
	dcfsnz	Remainder+1,f
	bra		Continue_div_4_1
	addwf	Remainder,f
	incf	Remainder+1,f
	return

Shift_all:
;	bcf		STATUS,C
	rlcf	Dividend,f
	rlcf	Dividend+1,f
	rlcf	Dividend+2,f
	rlcf	Dividend+3,f
	rlcf	Remainder,f
	rlcf	Remainder+1,f
	rlcf	Remainder+2,f
	rlcf	Remainder+3,f

	rlcf	Quotient,f
	rlcf	Quotient+1,f
	rlcf	Quotient+2,f
	rlcf	Quotient+3,f	
	return

; 22222222222222222222222222222222222222222222222222222222222
_4_div_2:
	movff	Dividend+3,Remainder+1
	movff	Dividend+2,Remainder
	movff	Dividend+1,Dividend+3
	movff	Dividend,Dividend+2
	clrf	Dividend+1
	clrf	Dividend
		
	movlw	.16
	movwf	Counter
Begin_Div_RLF_4_2:
	call	Shift_all
	call	check_div_pos_4_2			; checking if devide possible

	decfsz	Counter,f
	bra		Begin_Div_RLF_4_2
	return

check_div_pos_4_2:
	movf	Divisor,w
	subwf	Remainder,f
	movf	Divisor+1,w
	subwfb	Remainder+1,f
	bnc		Fix_Sub_4_2
Continue_div_4_2:
	call	Quotient_increase
	bra		check_div_pos_4_2

Fix_Sub_4_2:
	dcfsnz	Remainder+2,f
	bra		Continue_div_4_2
	movf	Divisor,w
	addwf	Remainder,f
	movf	Divisor+1,w
	addwfc	Remainder+1,f
	incf	Remainder+2,f
	return

_4_div_3:
	movff	Dividend+3,Remainder+2
	movff	Dividend+2,Remainder+1
	movff	Dividend+1,Remainder
	movff	Dividend,Dividend+3	
	clrf	Dividend+2
	clrf	Dividend+1
	clrf	Dividend
		
	movlw	.8
	movwf	Counter
Begin_Div_RLF_4_3:
	call	Shift_all
	call	check_div_pos_4_3			; checking if devide possible

	decfsz	Counter,f
	bra		Begin_Div_RLF_4_3
	return

check_div_pos_4_3:
	movf	Divisor,w
	subwf	Remainder,f
	movf	Divisor+1,w
	subwfb	Remainder+1,f
	movf	Divisor+2,w
	subwfb	Remainder+2,f
	bnc		Fix_Sub_4_3
Continue_div_4_3:
	call	Quotient_increase
	bra		check_div_pos_4_3

Fix_Sub_4_3:
	dcfsnz	Remainder+3,f
	bra		Continue_div_4_3
	movf	Divisor,w
	addwf	Remainder,f
	movf	Divisor+1,w
	addwfc	Remainder+1,f
	movf	Divisor+2,w
	addwfc	Remainder+2,f
	incf	Remainder+3,f
	return









;_4bytes_c_AdevideB_3 AA , B , Result , Counter , Temp1 , Temp2

; http://ww1.microchip.com/downloads/en/AppNotes/00526e.pdf





;	_4bytes_c_AdevideB intAdr , intAdr+5 , Result , Temp1 

;	_2uint_c_AmultiplyB intAdr , intAdr+2 , Result


;	_4bytesNegate_PS FSR0L

;	_2uint_c_AmultiplyB FSR0L , FSR1L , FSR2L

;	_2uints_c_AminusB_PS FSR0L , FSR1L , FSR2L  

movf	POSTINC1,w
subwf	POSTINC0,w
movwf	POSTINC2,
movf	INDF1,w
subwfb	INDF0,w
movwf	INDF2

;	lfsr	FSR1,0x0030 ; Temp storage of BCD

;	_2ints_c_AminusB_PS FSR0L , FSR1L , FSR2L

;	_4bytesZeroChecking FSR1L

;	itoBCD FSR0L , FSR1L , FSR2L

;	itoa FSR0L , FSR1L , FSR2L , 0x10

	_2longs_c_AminusB FSR0L , FSR1L , FSR2L

	_2longs_c_AplusB FSR0L , FSR1L , FSR2L
;	_2ints_c_AplusB_PS FSR0L , FSR1L , FSR2L
;	_2bytes_Swap FSR0L

;	_3bytesSwap FSR0L 

;	_3bytesTo4Swap FSR0L , FSR1L


;	comf	POSTINC0,f
;	comf	POSTINC0,f
;	comf	POSTINC0,f
;	negf	POSTDEC0
;	movlw	0
;   addwfc	POSTDEC0,f
;   addwfc	POSTDEC0,f
;   addwfc	INDF0,f
;	_4bytesNegate FSR0L

	lfsr	FSR1,Temp2
	lfsr	FSR0,intAdr+2
	lfsr	FSR2,Result 
 

; C = A + B
;	_2ints_c_AplusB_PS FSR0L , FSR1L , FSR2L

; C = A - B
;	_2ints_c_AplusB FSR0L , FSR1L , FSR2L



; C = A - B
;	comf	Temp1,f
;	comf	Temp2,f
;	infsnz	Temp1,f
;	incf	Temp2,f
;	movf	intAdr+2,w
;	addwf	Temp1,w
;	movwf	Result
;	movf	intAdr+3,w
;	addwfc	Temp2,w
;	movwf	Result+1


	
	_4bytesNegate_BigEndian FSR0L

	lfsr	FSR0,BCDAdr

	lfsr	FSR1,intAdr
    movlw	intL
	movwf	POSTINC1,ACCESS
    movlw	intH
	movwf	POSTDEC1,ACCESS	




	END