在Access中组合IIf语句

时间:2016-06-04 19:54:42

标签: sql ms-access

一直在尝试,但未成功在下面的查询中包含IIf语句。

下面的查询计算玩家拥有的匹配数。这涉及所有法院。 现在我想计算每位球员的输赢比赛,但也取决于表面。在这个例子中“硬”。

尝试了所有事情但不断出错。

section .data
    num:        dq      102 ;my default number to get the reverse of (for now)
    nl:         db      0x0a
    nlsize:     equ     $-nl
    ten:        dq      10

section .bss
    rem:        resq        1
    remsize:    equ     $-rem

section .text
    global _start

_start:

    cmp qword [num], 0
        jng _exit       ;jump to _exit if num is not greater than 0
    mov rax, [num]      ;move the number to rax
    mov rbx, [num]      ;move the number to rbx as well so that i have original number in register to subtract and get the remainder
    mov rcx, [ten]      ;move 10 to rcx to be the divisor
    div rcx             ;divide number in rax by 10
    mov [num], rax      ;get the quotient to get the remaining number for quotient
    mul rcx             ;multiply number in rax by 10
    sub rbx, rax        ;subtract rbx - rax and store the value in rax (right?)
    mov [rem], rbx      ;get the remainder from rax. this must be done right after div (WHY??????????)
    call _disprem       ;call _disprem to display the remainder... call returns the flow back to the caller right?
    jmp _start          ;get to the loop again

_exit:
    mov rax, 60
    mov rdi, 0
    syscall

_newl:
    mov rax, 1
    mov rdi, 1
    mov rsi, nl
    mov rdx, nlsize
    syscall
    ret

_disprem:
    mov rax, 1
    mov rdi, 1
    add qword [rem], 0x0000000000000030 ;since the rem variable is quadword (64 bit)
    mov rsi, rem
    mov rdx, remsize
    syscall
    sub qword [rem], 0x0000000000000030 ;get me my original number back plz thanks
    call _newl
    ret

0 个答案:

没有答案