code -8번항을 보려고 들어갔다가 그냥 전부 정리해두려고 적습니다.

애플 개발자문서에서는 이름만 나오고 값소개가 안되있길래 그냥 라이브러리쪽 복사해서 보기편하려고 번역기 돌렸습니다.

 

 

public enum Code : Int {

    /// Authentication was not successful, because user failed to provide valid credentials.

    // 사용자가 유효한 자격 증명을 제공하지 못했기 때문에 인증에 실패했습니다.

    case authenticationFailed = -1

 

    /// Authentication was canceled by user (e.g. tapped Cancel button).

    /// 사용자가 인증을 취소했습니다 (예 : 취소 버튼을 탭함).

    case userCancel = -2

 

    /// Authentication was canceled, because the user tapped the fallback button (Enter Password).

    /// 사용자가 대체 버튼 (암호 입력)을 탭했기 때문에 인증이 취소되었습니다.

    case userFallback = -3

 

    /// Authentication was canceled by system (e.g. another application went to foreground).

    /// 시스템에서 인증을 취소했습니다 (예 : 다른 애플리케이션이 포 그라운드로 전환됨).

    case systemCancel = -4

 

    /// Authentication could not start, because passcode is not set on the device.

    /// 기기에 비밀번호가 설정되어 있지 않아 인증을 시작할 수 없습니다.

    case passcodeNotSet = -5

 

    /// Authentication could not start, because Touch ID is not available on the device.

    /// 장치에서 Touch ID를 사용할 수 없어 인증을 시작할 수 없습니다.

    @available(iOS, introduced: 8.0, deprecated: 11.0, message: "use LAErrorBiometryNotAvailable")

    case touchIDNotAvailable = -6

 

    /// Authentication could not start, because Touch ID has no enrolled fingers.

    /// Touch ID에 등록 된 손가락이 없어 인증을 시작할 수 없습니다.

    @available(iOS, introduced: 8.0, deprecated: 11.0, message: "use LAErrorBiometryNotEnrolled")

    case touchIDNotEnrolled = -7

 

    /// Authentication was not successful, because there were too many failed Touch ID attempts and

    /// Touch ID is now locked. Passcode is required to unlock Touch ID, e.g. evaluating

    /// LAPolicyDeviceOwnerAuthenticationWithBiometrics will ask for passcode as a prerequisite.

    @available(iOS, introduced: 9.0, deprecated: 11.0, message: "use LAErrorBiometryLockout")

    /// 실패한 Touch ID 시도가 너무 많았 기 때문에 인증에 실패했습니다.

    /// 이제 Touch ID가 잠겨 있습니다. Touch ID를 잠금 해제하려면 암호가 필요합니다. 평가

    /// LAPolicyDeviceOwnerAuthenticationWithBiometrics는 전제 조건으로 암호를 요청합니다.

    case touchIDLockout = -8

 

    /// Authentication was canceled by application (e.g. invalidate was called while

    /// authentication was in progress).

    /// 인증이 애플리케이션에 의해 취소되었습니다 (예 : invalidate가 호출되는 동안

    /// 인증이 진행 중입니다)

    @available(iOS 9.0, *)

    case appCancel = -9

 

    /// LAContext passed to this call has been previously invalidated.

    ///이 호출에 전달 된 LAContext는 이전에 무효화되었습니다.

        @available(iOS 9.0, *)

    case invalidContext = -10

 

/// 장치에서 생체 측정을 사용할 수 없기 때문에 인증을 시작할 수 없습니다.

 @available (iOS 11.0, *)

 public static var biometryNotAvailable : LAError.Code {get}

 

 

 /// 생체 측정에 등록 된 ID가 없기 때문에 인증을 시작할 수 없습니다.

 @available (iOS 11.0, *)

 public static var biometryNotEnrolled : LAError.Code {get}

 

 

 /// 실패한 생체 측정 시도가 너무 많았 기 때문에 인증에 실패했습니다.

 /// 이제 생체 측정이 잠겨 있습니다. 생체 측정을 잠금 해제하려면 암호가 필요합니다. 평가

 /// LAPolicyDeviceOwnerAuthenticationWithBiometrics는 전제 조건으로 암호를 요청합니다.

 @available (iOS 11.0, *)

 public static var biometryLockout : LAError.Code {get}

 

 /// 금지 된 UI를 표시해야하므로 인증에 실패했습니다.

 /// interactionNotAllowed 속성을 사용합니다.

 

 @available (iOS 8.0, *)

 case notInteractive = -1004

}

원하는 영역 드래그로 지정 ( 또는 전체 지정: ⌘(command) + a) 

상태에서 ⌘(command) + k + f

 

문서 전체 자동 정렬

(shift) + option(⌥) + f 

 

단 이는 해당 문서의 확장자가 확정 지어 있어( 파일이 생성되어)야 하며 해당 확장자의 정렬 확장파일이 설치되어있어야함(자동으로 다운받는 경우가 많음)

 

 

밑은 공식 홈페이지에서 제공중인 핫키 테이블의 캡쳐 사진입니다.

 

 

(2020년 9월 1일자 스크린샷)

링크: https://code.visualstudio.com/shortcuts/keyboard-shortcuts-macos.pdf

 

https://wiwi-pe.tistory.com/73

 

firebase를 다루면서 며칠만에 열어본 프로젝트가 오류를 뱉는다.

오류 내용은 30개의 정의되지 않은 내용이 있다는 사항 "_OBJC_CLASS_$_APMAnalytics", 가 없다 뭐 가 없다  내가 정의하지않은 부분이라 당황하면서도 클린도 해보고 껏다 켜보기도하고 해도 안되다가 �

wiwi-pe.tistory.com

위 게시글 쓰면서 라이브러리가 손상됐다기보단 라이브러리가 변경되어서 다루는부분에서 문제가 생긴줄 알았는데 파일자체가 손상된거였다.

 

손상되는 이유는 어이없게도 icloud 자동업로드 기능...

 

항상 나에게 도움을 주시는 스택오버플로우에서 나온 답변이다.

 

https://stackoverflow.com/questions/56931305/framework-not-found-googleappmeasurement-getting-error-while-adding-framework

 

"Framework not found GoogleAppMeasurement" Getting error while adding framework manually

when I try to add framework manually it shows me error like " Framework not found GoogleAppMeasurement" and when I checked it in details it looks like following: ld: framework not found

stackoverflow.com

pod파일에서 들어가서 파일을 직접적으로 가지고있어야만 손상이 안간다고한다.

아니면 그냥 icloud 범위밖으로 빼버리고 작업

 

난 그냥 빼버리고 작업하고있다.

오류 내용은 30개의 정의되지 않은 내용이 있다는 사항

"_OBJC_CLASS_$_APMAnalytics", 가 없다 뭐 가 없다  

내가 정의하지않은 부분이라 당황하면서도 클린도 해보고 껏다 켜보기도하고 해도 안되다가

 

결국 Pod update를 호출 하니 다시 돌아간다.

 

며칠인데도 뭔가 업데이트 사항이 있었나보다

 

이것도 안되면 그냥 pod로 깐 라이브러리들을 죄다 지우고 다시 설치해볼 생각이였으나 update로 해결되서 다행임.

사용자로부터 2byte 의 10진수를 입력받고 입력받은수를 2진수로 출력하라.

 

바로 nasm으로 적어보려고했으나 잘안되서 c로 먼저 굴려봤습니다.

#include <stdio.h>

int main(int argc, const char * argv[]) {
    int target = 0;
    int remain[100] = {0,};
    int index = 0;
    scanf("%d",&target);
    while (target > 1) {
        remain[index] = target % 2;
        target = target / 2;
        index++;
    }
    printf("%d\n",target);
    for (int i = index - 1; i >= 0; i--) {
        printf("%d\n", remain[i]);
    }
    return 0;
}

이렇게나 간단한건데

속이 터지네요

 

 

계속 문제가 생기는  mov eax, dword [target] 부분을

and eax, 0x0000ffff 추가로 땜빵해줬습니다...

필요한 부분은 ax뿐만이라(2byte수 제한) 솔직히 앞부분은 필요없기도하고........

 

누가좀 알려줬으면 좋겠네요

 

%include "io64.inc"

 

section .text

global CMAIN

CMAIN:

mov rbp, rsp; for correct debugging

GET_DEC 2, ax

mov [target], ax

L_loop:

mov eax, 0

mov edx, 0

 

mov eax, dword [target]

and eax, 0x0000ffff

 

mov edx, eax

shr edx, 16

and eax, 0x0000ffff

 

mov ebx, 0

mov bx, 2

div bx

 

mov ebx, [remainder_index]

mov [remainder + ebx * 2], dx

add [remainder_index], word 1

 

mov [target], ax

cmp ax, 1

jle L_loop_end

jmp L_loop

L_loop_end:

;print

PRINT_DEC 2, target

;NEWLINE

 

mov eax, 0

mov eax, [remainder_index]

dec eax

 

L_print_loop:

PRINT_DEC 2, [remainder + eax * 2]

;NEWLINE

add [print_count], word 1

 

dec ax

mov bx, [print_count]

cmp bx, [remainder_index]

je L_end

jmp L_print_loop

L_end:

xor rax,rax

ret

section .bss

target resw 1

remainder resw 100

section .data

remainder_index dw 0

print_count dw 0

'NASM' 카테고리의 다른 글

9일차  (0) 2020.06.23
8일차.  (0) 2020.06.21
7일차.  (0) 2020.06.20
6일차.  (0) 2020.06.19
5일차.  (0) 2020.06.18

1~ 입력받은 수(2byte)까지의 3의 배수를 구하고 그 수를 출력, 합을 출력

 

%include "io64.inc"

 

section .text

global CMAIN

CMAIN:

mov rbp, rsp; for correct debugging

GET_DEC 2, input

 

L_loop:

add [for_index],word 1 ; 반복 인덱스값 증가

 

;인덱스값이 3의 배수인지 판별하려고 3으로나눠봄

mov eax, [for_index]

;dx에 전반부 ax에 후반부로 나눠야 계산이됨 - 실제 저장된건 리틀엔디안 스타일이기에 값으로는 반대

mov edx, eax

shr edx, 16

 

and eax, 0x0000ffff

 

mov bx, 3

div bx ; 값은 ax에 몫, dx에 나머지가 저장됨

 

cmp dx, 0 ; 나머지가 0인지 판별하려고함

jne L_after_save ;0이 아니라면 데이터배열에 저장하지않음

 

;데이터배열에 저장

mov eax, 0

mov ax, [data_index]

mov bx, [for_index]

mov [data + eax * 2], bx

inc ax

mov [data_index], ax

 

L_after_save:

mov bx, [for_index]

cmp bx, [input]

jne L_loop; for_index가 입력된 값과 같을때까지 반복

 

; 저장된 값 출력

PRINT_STRING str_print_start

mov eax, 0

L_print_loop:

;3의 배수값 출력 + 합구하기

mov dx, [data + eax * 2]

add [total], dx

PRINT_DEC 2, dx

PRINT_STRING str_comma_space

 

inc ax

 

mov bx, [data_index]

cmp ax, bx

jne L_print_loop

 

NEWLINE

;저장된 개수

PRINT_STRING str_count

PRINT_DEC 2, [data_index]

NEWLINE

;합

PRINT_STRING str_total

PRINT_DEC 2, [total]

NEWLINE

 

xor rax, rax

ret

 

section .bss

data resw 100

input resw 1

section .data

data_index dw 0

for_index dw 0

total dw 0

;msg

str_print_start db '3의 배수 : ',0x00

str_comma_space db ', ',0x00

str_count db '3의 배수 갯수 : ',0x00

str_total db '총합 : ',0x00

 

2byte수를 한 개 입력 받아(10진수) 이 숫자를 2진수로 출력하라

막혔음... 

c로 하면 간단한데 어디서 문제가 생긴지 모르겠다.

 

 

 

 

'NASM' 카테고리의 다른 글

10일차.  (0) 2020.06.24
8일차.  (0) 2020.06.21
7일차.  (0) 2020.06.20
6일차.  (0) 2020.06.19
5일차.  (0) 2020.06.18

배열 복사...  디버깅 테스트용

디버깅 메뉴에서 show memory 에 들어가면 각 변수별 관찰이 가능하다.

변수이름을 적고 타입을 정하면 실행시 자동으로 값이 보임

주소값으로도 볼 수 있는데 왼쪽의 address를 꼭 체크해야 된다.

%include "io64.inc"

 

section .text

global CMAIN

CMAIN:

;write your code here

mov eax, my1

mov ebx, you1

 

mov edx, 0

mov ecx, 3

 

L1:

mov eax, [my1 + edx * 2]

mov [you1 + edx * 2], eax

inc edx

loop L1

 

mov edx, 0

L2:

PRINT_HEX 2, my1 + edx * 2

NEWLINE

inc edx

cmp edx, 3

jl L2

 

xor rax, rax

ret

 

section .data

my1 dw 0x1234, 0x4567, 10

 

section .bss

you1 resw 3

4- 문제

2바이트 수 한개를 입력받고 1 ~ 입력받은수 까지의 3의 배수만 배열에 저장하고 그 개수와 값을 출력

 

풀다가 못풀었음.; 내일로 미룸

'NASM' 카테고리의 다른 글

10일차.  (0) 2020.06.24
9일차  (0) 2020.06.23
7일차.  (0) 2020.06.20
6일차.  (0) 2020.06.19
5일차.  (0) 2020.06.18

반복문

 

%inlucde "io64.inc"

section .text

global CMAIN

CMAIN:

;write your code here

mov ax, 0

mov ecx, 10

 

L_loop:

add ax, cx

loop L_loop

 

PRINT_DEC 2, ax

NEWLINE

 

xor rax, rax

ret

 

inc,  1증가

 

%include "io64.inc"

 

section .text

global CMAIN

CMAIN:

;write your code here

mov ax,0

mov bx,1

mov cx,10

L_L1:

add ax,bx

inc bx

loop L_L1

 

PRINT_DEC 2, ax

NEWLINE

 

xor rax, rax

ret

 

 

 

do while

 

%include "io64.inc"

 

section .text

global CMAIN

CMAIN:

;write your code here

mov ax,0

mov bx,0

L1:

add ax, bx

inc bx

cmp bx, 10

jle L1

 

PRINT_DEC 2,ax

NEWLINE

xor rax, rax

ret

 

 

while

 

%include "io64.inc"

 

section .text

global CMAIN

CMAIN:

;write your code here

mov ax,0

mov bx,0

L1:

cmp bx, 10

jg L2

add ax, bx

inc bx

jmp L1

L2:

PRINT_DEC 2, ax

NEWLINE

xor rax, rax

ret

 

 

배열 접근하기 

 

include "io64.inc"

 

section .text

global CMAIN

CMAIN:

;write your code here

mov al, [a]

PRINT_DEC 1, al

NEWLINE

 

mov al, [a+1]; a는 1바이트 크기

PRINT_DEC 1, al

NEWLINE

 

mov ax, [b]

PRINT_HEX 2, ax

NEWLINE

 

mov ax, [b + 1 * 2]

PRINT_HEX 2, ax

NEWLINE

 

mov ax, [b + 2 * 2]

PRINT_DEC 2, ax

NEWLINE

 

xor rax, rax

ret

 

section .data

a db 30,50,60

b dw 0x1234, 0x5678, 10

 

배열 복사.

포인트는 괄호 내부안에 들어가는 레지스터 변수는 무조건 4바이트 변수로 넣을것 밑에 보면 인덱스를 굳이 eax로 한 이유임 

include "io64.inc"

 

section .text

global CMAIN

CMAIN:

;write your code here

mov eax, 0

mov ecx, 3

 

L1:

mov ebx,[origin + eax * 2]; eax에 인덱스값을 저장 2바이트크기 변수임

mov [copy + eax * 2], ebx

inc eax

loop L1

 

mov edx, copy;edx에 copy시작주소를 넣음.. 왜?

mov eax, 0

L2:

PRINT_HEX 2, [edx + eax * 2]

NEWLINE

inc eax

cmp eax,3

jl L2

 

xor rax, rax

ret

 

section .data

origin dw 0x1234,0x4567, 0x8912

section .bss

copy resw 3

 

 

'NASM' 카테고리의 다른 글

9일차  (0) 2020.06.23
8일차.  (0) 2020.06.21
6일차.  (0) 2020.06.19
5일차.  (0) 2020.06.18
4일차.  (0) 2020.06.17

+ Recent posts