Compare commits
2 Commits
rewrite_id
...
main
Author | SHA1 | Date | |
---|---|---|---|
0c4d4cbf9d | |||
ae90da403c |
@@ -284,7 +284,7 @@ MEM_AMOUNT = OS_BASE + 0x000FE8C
|
||||
SYS_SHUTDOWN = OS_BASE + 0x000FF00
|
||||
|
||||
|
||||
TMP_STACK_TOP = 0x008CC00
|
||||
TMP_STACK_TOP = 0x0096F00
|
||||
|
||||
sys_proc = OS_BASE + 0x008E000
|
||||
|
||||
|
@@ -175,7 +175,7 @@ iglobal
|
||||
dd sys_socket ; 75-reserved for new stack
|
||||
dd sys_protocols ; 76-reserved for new stack
|
||||
dd sys_posix ; posix support
|
||||
dd undefined_syscall ; 78-free
|
||||
dd syscall_qrcode ; 78-QR code
|
||||
dd undefined_syscall ; 79-free
|
||||
dd sys_fileSystemUnicode ; 80-File system interface for different encodings
|
||||
|
||||
|
@@ -4430,6 +4430,8 @@ sys_apm:
|
||||
ret
|
||||
; -----------------------------------------
|
||||
|
||||
include 'qrcode.inc'
|
||||
|
||||
align 4
|
||||
undefined_syscall: ; Undefined system call
|
||||
mov [esp + SYSCALL_STACK.eax], -1
|
||||
|
2153
kernel/trunk/qrcode.inc
Normal file
2153
kernel/trunk/qrcode.inc
Normal file
File diff suppressed because it is too large
Load Diff
218
programs/other/qrclipboard/qrclipboard.asm
Normal file
218
programs/other/qrclipboard/qrclipboard.asm
Normal file
@@ -0,0 +1,218 @@
|
||||
; QR code generator from clipbboard
|
||||
;
|
||||
; This program uses code from someone else's program, so the notice below
|
||||
; is kept for compliance purposes.
|
||||
|
||||
|
||||
;*****************************************************************************
|
||||
; Read the data from the clipboard
|
||||
; Copyright (c) 2013, Marat Zakiyanov aka Mario79, aka Mario
|
||||
; All rights reserved.
|
||||
;
|
||||
; Redistribution and use in source and binary forms, with or without
|
||||
; modification, are permitted provided that the following conditions are met:
|
||||
; * Redistributions of source code must retain the above copyright
|
||||
; notice, this list of conditions and the following disclaimer.
|
||||
; * Redistributions in binary form must reproduce the above copyright
|
||||
; notice, this list of conditions and the following disclaimer in the
|
||||
; documentation and/or other materials provided with the distribution.
|
||||
; * Neither the name of the <organization> nor the
|
||||
; names of its contributors may be used to endorse or promote products
|
||||
; derived from this software without specific prior written permission.
|
||||
;
|
||||
; THIS SOFTWARE IS PROVIDED BY Marat Zakiyanov ''AS IS'' AND ANY
|
||||
; EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
; DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
|
||||
; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
; (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
; ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
;******************************************************************************
|
||||
use32
|
||||
org 0x0
|
||||
|
||||
db 'MENUET01'
|
||||
dd 0x01
|
||||
dd START
|
||||
dd IM_END
|
||||
dd I_END
|
||||
dd stacktop
|
||||
dd 0x0
|
||||
dd 0x0
|
||||
;---------------------------------------------------------------------
|
||||
include 'macros.inc'
|
||||
|
||||
START:
|
||||
mcall 68,11
|
||||
red:
|
||||
call draw_window
|
||||
still:
|
||||
mcall 10
|
||||
|
||||
cmp eax,1
|
||||
je red
|
||||
cmp eax,2
|
||||
je key
|
||||
cmp eax,3
|
||||
je button
|
||||
|
||||
jmp still
|
||||
|
||||
key:
|
||||
mcall 2
|
||||
jmp still
|
||||
|
||||
button:
|
||||
mcall 17
|
||||
cmp ah,2
|
||||
je .read_button
|
||||
cmp ah,1
|
||||
jne still
|
||||
.exit:
|
||||
mcall -1
|
||||
|
||||
.read_button:
|
||||
call draw_clipboard
|
||||
jmp still
|
||||
|
||||
draw_window:
|
||||
mcall 12,1
|
||||
xor esi,esi
|
||||
mcall 0,<0,600>,<0,400>,0x13FFFFFF,,title
|
||||
mcall 8,<20,150>,<40,20>,2,0xCCCCCC
|
||||
mcall 4,<25,47>,0x90000000,read_button_text
|
||||
mcall 12,2
|
||||
ret
|
||||
|
||||
draw_clipboard:
|
||||
mcall 54,0
|
||||
cmp eax,-1
|
||||
je exit
|
||||
|
||||
test eax,eax
|
||||
jz exit
|
||||
|
||||
mov [slots_number],eax
|
||||
dec eax
|
||||
mov [current_slot],eax
|
||||
|
||||
mov [text_coordinates],dword 10 shl 16+70
|
||||
start:
|
||||
xor eax,eax
|
||||
mov [current_slot_data],eax
|
||||
mcall 54,1,[current_slot]
|
||||
|
||||
cmp eax,-1
|
||||
je .no_relevant_data
|
||||
|
||||
cmp eax,1
|
||||
jne @f
|
||||
|
||||
.no_relevant_data:
|
||||
mov edx,no_relevant_data_text
|
||||
mov esi,no_relevant_data_text.end-no_relevant_data_text
|
||||
jmp print
|
||||
.no_relevant_data_1:
|
||||
mov edx,no_relevant_data_text_1
|
||||
mov esi,no_relevant_data_text_1.end-no_relevant_data_text_1
|
||||
jmp print
|
||||
.no_relevant_data_2:
|
||||
mov edx,no_relevant_data_text_2
|
||||
mov esi,no_relevant_data_text_2.end-no_relevant_data_text_2
|
||||
jmp print
|
||||
@@:
|
||||
mov [current_slot_data],eax
|
||||
mov eax,[current_slot_data]
|
||||
mov esi,[eax]
|
||||
sub esi,12
|
||||
add eax,4
|
||||
cmp [eax],dword 2
|
||||
jge .no_relevant_data_1
|
||||
add eax,4
|
||||
;cmp [eax],dword 1 ; cp866
|
||||
;je .no_relevant_data_2 ;
|
||||
|
||||
|
||||
;push 0
|
||||
cmp [eax], dword 0
|
||||
jne @f
|
||||
; push 26
|
||||
jmp skip2
|
||||
@@:
|
||||
cmp [eax], dword 2
|
||||
jne @f
|
||||
;push 22
|
||||
jmp skip2
|
||||
@@:
|
||||
|
||||
|
||||
skip2:
|
||||
|
||||
add eax,4
|
||||
mov edx, matrix
|
||||
mov ebx, eax
|
||||
mov ecx, esi
|
||||
mov eax, 78
|
||||
int 0x40
|
||||
|
||||
mov ebx, matrix
|
||||
mov ecx, eax
|
||||
shl ecx, 16
|
||||
add ecx, eax
|
||||
mov eax, 7
|
||||
mov edx, 40
|
||||
shl edx, 16
|
||||
add edx, 80
|
||||
int 0x40
|
||||
doneQR:
|
||||
print:
|
||||
mov ecx,[current_slot_data]
|
||||
test ecx,ecx
|
||||
jz @f
|
||||
@@:
|
||||
add [text_coordinates],dword 15
|
||||
dec dword [current_slot]
|
||||
dec dword [slots_number]
|
||||
exit:
|
||||
ret
|
||||
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
title:
|
||||
db 'Make QR code from the clipboard ',0
|
||||
read_button_text:
|
||||
db 'Make QR code ',0
|
||||
no_relevant_data_text:
|
||||
db '<NO RELEVANT DATA>',0
|
||||
.end:
|
||||
no_relevant_data_text_1:
|
||||
db '<NO TEXT>',0
|
||||
.end:
|
||||
no_relevant_data_text_2:
|
||||
db '<NO 866>',0
|
||||
.end:
|
||||
;---------------------------------------------------------------------
|
||||
IM_END:
|
||||
slots_number:
|
||||
rd 1
|
||||
text_coordinates:
|
||||
rd 1
|
||||
current_slot:
|
||||
rd 1
|
||||
current_slot_data:
|
||||
rd 1
|
||||
|
||||
;----------------------
|
||||
|
||||
matrix DD 31330 * 3 DUP (?)
|
||||
|
||||
;--------------------------------------
|
||||
rb 5555
|
||||
stacktop:
|
||||
rb 4
|
||||
;---------------------------------------------------------------------
|
||||
I_END:
|
||||
;---------------------------------------------------------------------
|
Reference in New Issue
Block a user