パイプライン
- パイプライン数はCortex-M0+は2段、Cortex-M0/M3/M4は3段
- 段数が多いとジャンプ命令に於ける破棄情報が多い
- Cortex-M0+の方がパイプライン数が少ない分、分岐処理が高性能
Interface(2016/2)より
フラッシュメモリ
- フラッシュメモリの消費電力はRAMと比較して4割増しである
- フラッシュメモリをアクセスするよりもRAMをアクセスしたほうが、消費電力も速度も性能が上がる
Interface(2016/2)より
; 第3章 コンパイル、リンク、ロケート
MEMORY {
ram: ORIGIN=0x00000, LENGTH=512K
rom: ORIGIN=0x80000, LENGTH=512K
}
SECTIONS {
data ram: {
_DataStart = .;
*(.data)
_DataEnd = .;
} >rom
bss: {
_BssStart = .;
*(.bss)
_BssEnd = .;
}
_BottomOfHealp = .;
_TopOfStack = 0x80000;
text rom: {
*(.text)
}
}
/*
組み込みシステムプログラミング
第二章 点滅するライト
*/
#define LED_GREEN 0x40
#define P2LTCH 0xff5e /* P2LTCHレジスタのオフセット */
/*
LED状態を反転
ArcomのTarget188EB専用
*/
void toggleLed(unsigned char ledMask)
{
asm {
mov dx,P2LTCH /* レジスタのアドレスをロード */
in al,dx /* レジスタの内容読み込み */
mov ah,ledMask /* ledMaskをレジスタにコピー */
xor al,ah /* ビット反転 */
out dx,al /* レジスタに反転情報書き込み */
};
}
/*
指定された秒数待つ
*/
void delay(unsigned int nMilliseconds)
{
#define CYCLES_PER_MS 260
unsigned long nCycles = nMilliseconds*CYCLES_PER_MS;
while (nCycles--);
}
/*
緑色LEDを一秒間に一回点滅させる
*/
void main(void)
{
while (1) {
toggleLed(LED_GREEN);
delay(500);
}
}
typedef unsigned char datum; /* データバスの設定を8bitにする */
/*
メモリ領域の特定アドレスに置かれているウォーキングワンテストを実行。
*/
datum memTestDataBus(volatile datum *address)
{
datum pattern;
for (pattern = 1; pattern != 0; pattern <<= 1) {
*address = pattern; /* テストパターンを書く */
if (*address != pattern) { /* 読み直し */
return pattern;
}
}
return 0;
}
tupleアクセスはget<...>を使用する。data;
char *name = get<0>(data);get<...>は代入にも使用可能。ただし、const メソッドでない限り
bool resource = get<1>(data);
std::wstring& expand = get<2>(data);
/^#{key}/
/^==(?!\[IsConstrainedOptions)/
absolute_path(file_name, dir_string=nil) -> String
p File::absolute_path(Dir::pwd)
#=> "c:/Users/hisa/Programming/ruby"
p File::absolute_path(".")
#=> "c:/Users/hisa/Programming/ruby"
p File::absolute_path("..")
#=> "c:/Users/hisa/Programming/ruby/~/Canon"
p File::absolute_path("..", 'c:\home\hisa')
#=>"c:/home"
atime(filename) -> Time
p File::atime("..").to_s
#=> "2015-03-17 14:22:29 +0900"
p File::atime("File_atime.rb").to_s
#=> "2015-12-09 16:49:04 +0900"
require 'win32ole'doc-paragrphの順に情報が構成されている模様。
word = WIN32OLE.new('Word.Application')
word.Visible = true
doc = word.Documents.Add()
paragraph = doc.Content.Paragraphs.Add
paragraph.Range.Text = "Hello World!"
ieにはOLEオブジェクトを取得し、Navigateでアドレス指定、Visible=trueにすることで表示を行う。
require 'win32ole'
ie = WIN32OLE.new('InternetExplorer.Application')
ie.Navigate("http://www.google.co.jp")
ie.Visible = true
while ie.busy
sleep 1
end
q = ie.document.all.Item("q")
q.Value = "win32ole"
btnG = ie.document.all.Item("btnG")
btnG.click()
タグ、btnGは検索開始ボタンである。
typedef tupe<...> T;
vector...;
*MSPrintSchemaKeywordMap: JobA *A*MSPrintSchemaKeywordMap: JobA ADefault *A O1*MSPrintSchemaKeywordMap: JobA AO2 *A O2
*OpenUI *A: PickOne
*DefaultA: O1
*A O1: ""
*A O2: ""
*CloseUI: *A
using System;
using System.Collections.Generic;
using System.Linq;
using System.Printing;
using System.Text;
using System.Threading.Tasks;
namespace GetPrintTicket
{
class PTicket
{
static void Main(string[] args)
{
PTicket provider = new PTicket();
provider.run();
}
private void run()
{
PrintQueue printQueue = null;
LocalPrintServer localPrintServer = new LocalPrintServer();
PrintQueueCollection localPrinterCollection = localPrintServer.GetPrintQueues();
System.Collections.IEnumerator localPrinterEnumurator = localPrinterCollection.GetEnumerator();
for (;;)
{
if (!localPrinterEnumurator.MoveNext())
{
return;
}
printQueue = (PrintQueue)localPrinterEnumurator.Current;
if (printQueue.FullName == "PS Standard UI Replacement")
{
break;
}
}
PrintCapabilities printCapabilities = printQueue.GetPrintCapabilities();
Console.WriteLine("Capability");
Console.WriteLine("\tCollationCapability:");
for (int i = 0; i < printCapabilities.CollationCapability.Count; i++)
{
Console.WriteLine("\t\t" + printCapabilities.CollationCapability[i]);
}
Console.WriteLine("\tDeviceFontSubstitutionCapability:");
for (int i = 0; i < printCapabilities.DeviceFontSubstitutionCapability.Count; i++)
{
Console.WriteLine("\t\t" + printCapabilities.DeviceFontSubstitutionCapability[i]);
}
Console.WriteLine("\tDuplexingCapability:");
for (int i = 0; i < printCapabilities.DuplexingCapability.Count; i++)
{
Console.WriteLine("\t\t" + printCapabilities.DuplexingCapability[i]);
}
Console.WriteLine("\tInputBinCapability:");
for (int i = 0; i < printCapabilities.InputBinCapability.Count; i++)
{
Console.WriteLine("\t\t" + printCapabilities.InputBinCapability[i]);
}
Console.WriteLine("\tMaxCopyCount:" + printCapabilities.MaxCopyCount);
Console.WriteLine("\tOrientedPageMediaHeight:" + printCapabilities.OrientedPageMediaHeight);
Console.WriteLine("\tOrientedPageMediaWidth:" + printCapabilities.OrientedPageMediaWidth);
Console.WriteLine("\tOutputColorCapability:");
for (int i = 0; i < printCapabilities.OutputColorCapability.Count; i++)
{
Console.WriteLine("\t\t" + printCapabilities.OutputColorCapability[i]);
}
Console.WriteLine("\tOutputQualityCapability:");
for (int i = 0; i < printCapabilities.OutputQualityCapability.Count; i++)
{
Console.WriteLine("\t\t" + printCapabilities.OutputQualityCapability[i]);
}
Console.WriteLine("\tPageBorderlessCapability:");
for (int i = 0; i < printCapabilities.PageBorderlessCapability.Count; i++)
{
Console.WriteLine("\t\t" + printCapabilities.PageBorderlessCapability[i]);
}
Console.WriteLine("\tPageImageableArea:" + printCapabilities.PageImageableArea);
Console.WriteLine("\tPageMediaSizeCapability:");
for (int i = 0; i < printCapabilities.PageMediaSizeCapability.Count; i++)
{
Console.WriteLine("\t\t" + printCapabilities.PageMediaSizeCapability[i]);
}
Console.WriteLine("\tPageMediaTypeCapability:");
for (int i = 0; i < printCapabilities.PageMediaTypeCapability.Count; i++)
{
Console.WriteLine("\t\t" + printCapabilities.PageMediaTypeCapability[i]);
}
Console.WriteLine("\tPageOrderCapability:");
for (int i = 0; i < printCapabilities.PageOrderCapability.Count; i++)
{
Console.WriteLine("\t\t" + printCapabilities.PageOrderCapability[i]);
}
Console.WriteLine("\tPageOrientationCapability:");
for (int i = 0; i < printCapabilities.PageOrientationCapability.Count; i++)
{
Console.WriteLine("\t\t" + printCapabilities.PageOrientationCapability[i]);
}
Console.WriteLine("\tPageResolutionCapability:");
for (int i = 0; i < printCapabilities.PageResolutionCapability.Count; i++)
{
Console.WriteLine("\t\t" + printCapabilities.PageResolutionCapability[i]);
}
Console.WriteLine("\tPageScalingFactorRange:" + printCapabilities.PageScalingFactorRange);
Console.WriteLine("\tPagesPerSheetCapability:");
Console.WriteLine("\tPagesPerSheetDirectionCapability:");
for (int i = 0; i < printCapabilities.PagesPerSheetDirectionCapability.Count; i++)
{
Console.WriteLine("\t\t" + printCapabilities.PagesPerSheetDirectionCapability[i]);
}
Console.WriteLine("\tPhotoPrintingIntentCapability:");
for (int i = 0; i < printCapabilities.PhotoPrintingIntentCapability.Count; i++)
{
Console.WriteLine("\t\t" + printCapabilities.PhotoPrintingIntentCapability[i]);
}
Console.WriteLine("\tStaplingCapability:");
for (int i = 0; i < printCapabilities.StaplingCapability.Count; i++)
{
Console.WriteLine("\t\t" + printCapabilities.StaplingCapability[i]);
}
Console.WriteLine("\tTrueTypeFontModeCapability:");
for (int i = 0; i < printCapabilities.TrueTypeFontModeCapability.Count; i++)
{
Console.WriteLine("\t\t" + printCapabilities.TrueTypeFontModeCapability[i]);
}
PrintTicket printTicket = printQueue.DefaultPrintTicket;
Console.WriteLine("Ticket");
Console.WriteLine("\tCollation: " + printTicket.Collation);
Console.WriteLine("\tCopyCount: " + printTicket.CopyCount);
Console.WriteLine("\tDeviceFontSubstitution: " + printTicket.DeviceFontSubstitution);
Console.WriteLine("\tDuplexing: " + printTicket.Duplexing);
Console.WriteLine("\tInputBin: " + printTicket.InputBin);
Console.WriteLine("\tOutputColor: " + printTicket.OutputColor);
Console.WriteLine("\tOutputQuality: " + printTicket.OutputQuality);
Console.WriteLine("\tPageBorderless: " + printTicket.PageBorderless);
Console.WriteLine("\tPageMediaSize: " + printTicket.PageMediaSize);
Console.WriteLine("\tPageMediaType: " + printTicket.PageMediaType);
Console.WriteLine("\tPageOrder: " + printTicket.PageOrder);
Console.WriteLine("\tPageOrientation: " + printTicket.PageOrientation);
Console.WriteLine("\tPageResolution: " + printTicket.PageResolution);
Console.WriteLine("\tPageScalingFactor: " + printTicket.PageScalingFactor);
Console.WriteLine("\tPagesPerSheet: " + printTicket.PagesPerSheet);
Console.WriteLine("\tPagesPerSheetDirection: " + printTicket.PagesPerSheetDirection);
Console.WriteLine("\tPhotoPrintingIntent: " + printTicket.PhotoPrintingIntent);
Console.WriteLine("\tStapling: " + printTicket.Stapling);
Console.WriteLine("\tTrueTypeFontMode: " + printTicket.TrueTypeFontMode);
}
}
}
%skeleton "lalr1.cc"
| '{' error '}' { yy::parser::error("error: compound_statment"); $$ = nullptr; }
%option yylineno
/a2psdict 200 dict def
a2psdict begin
レジスタ名 | 使い道 |
---|---|
$11 | regsaveコントロール用テンポラリレジスタ |
$8 | fp |
$13 | tp |
$14 | gp |
$15 | sp |
$16 | psw |
$17 | lp |
$18 | sar |
$20 | rpb |
$21 | rfe |
$22 | rpc |
$23 | hi |
$24 | lo |
% llvm-gcc hw.cpp -S -emit-llvm #コンパイル(llvm-gcc版) % lli hw.S #実行
import xlrd
if __name__ == "__main__":
book = xlrd.open_workbook("...")
print book.nsheets
for name in book.sheet.names():
print name
日本語がうまく動かない様子
/TextIntent | 8 |
/.HWMargins | [0.0 0.0 0.0 0.0] |
/ImagingBBox | null |
/SimulateOverprint | TRUE |
/OutputDevice | /display |
/NumCopies | null 印刷部数を整数指定する |
/MaxSeparations | 3 |
/GraphicsAlphaBits | 1 |
/BlackPtComp | 8 |
/UseCIEColor | FALSE |
/PreBandThreshold | FALSE |
/Name | (display) |
/SeparationColorNames | [] |
/MaxPatternBitmap | 0 |
/GraphicBlackPt | 8 |
/%MediaDestination | 0 |
/GraphicICCProfile | () |
/.MediaSize | [595.0 842.0] |
/HWSize | [793 1123] |
/MaxBitmap | 10000000 |
/ImageBlackPt | 8 |
/%MediaSource | 0 |
/ImageICCProfile | () |
/HWResolution | [96.0 96.0] |
/BufferSpace | 4000000 |
/BandBufferSpace | 0 |
/TextBlackPt | 8 |
/TextICCProfile | () |
/PageDeviceName | null |
/DisplayFormat | 198788 |
/BandHeight | 0 |
/KPreserve | 8 |
/ProofProfile | () |
/Colors | 3 |
/.LockSafetyParams | FALSE |
/Margins | [0.0 0.0] |
/DisplayResolution | 96 |
/BandWidth | 0 |
/GraphicKPreserve | 8 |
/DeviceLinkProfile | () |
/ColorValues | -1 |
/RedValues | 256 |
/BeginPage | {--.callbeginpage--} |
/BitsPerPixel | 32 |
/PageOffset | [0 0] |
/ProcessColorModel | /DeviceRGB |
/DisplayHandle | (16#00000000) |
/ImageKPreserve | 8 |
/PageUsesTransparency | FALSE |
/ICCOutputColors | () |
/InputAttributes | -dict- |
/Separations | FALSE |
/GreenValues | 256 |
/EndPage | {--.callendpage--} |
/TextKPreserve | 8 |
/RenderIntent | 8 |
/DeviceGrayToK | TRUE |
/BlueValues | 256 |
/PageSize | [595.0 842.0] |
/PageCount | 0 |
/.MarginsHWResolution | [96.0 96.0] |
/OutputICCProfile | (default_rgb.icc) |
/GraphicIntent | 8 |
/OutputAttributes | -dict- |
/GrayDetection | FALSE |
/GrayValues | 256 |
/Policies | -dict- |
/.IgnoreNumCopies | FALSE |
/ImageIntent | 8 |
/Install | {--.callinstall--} |
/UseFastColor | FALSE |
/TextAlphaBits | 1 |
/PolicyNotFound | 1 |
/PageSize | 0 |
/PolicyReport | {--dup-- /.LockSafetyParams --known-- {/setpagedevice --.systemvar-- /invalidaccess signalerror} --if-- --pop--} |
/PolicyNotFound | 1 | |
/PageSize | 0 | |
/PolicyReport | {--dup-- /.LockSafetyParams --known-- {/setpagedevice --.systemvar-- /invalidaccess signalerror} --if-- --pop--} | |
0 | -dict- | |
/PageSize | [595.0 842.0] | |
1 | -dict- | |
/PageSize | [792 1224] | |
2 | -dict- | |
/PageSize | [612 792] | |
3 | -dict- | |
/PageSize | [792 1224] | |
4 | -dict- | |
/PageSize | [1224 1585] | |
5 | -dict- | |
/PageSize | [1585 2448] | |
6 | -dict- | |
/PageSize | [2448 3168] | |
7 | -dict- | |
/PageSize | [2448 3168] | |
8 | -dict- | |
/PageSize | [2384 3370] | |
9 | -dict- | |
/PageSize | [1684 2384] | |
10 | -dict- | |
/PageSize | [73 105] | |
11 | -dict- | |
/PageSize | [1191 1684] | |
12 | -dict- | |
/PageSize | [842 1191] | |
13 | -dict- | |
/PageSize | [595 842] | |
14 | -dict- | |
/PageSize | [595 842] | |
15 | -dict- | |
/PageSize | [420 595] | |
16 | -dict- | |
/PageSize | [297 420] | |
17 | -dict- | |
/PageSize | [210 297] | |
18 | -dict- | |
/PageSize | [148 210] | |
19 | -dict- | |
/PageSize | [105 148] | |
20 | -dict- | |
/PageSize | [648 864] | |
21 | -dict- | |
/PageSize | [864 1296] | |
22 | -dict- | |
/PageSize | [1296 1728] | |
23 | -dict- | |
/PageSize | [1728 2592] | |
24 | -dict- | |
/PageSize | [2592 3456] | |
25 | -dict- | |
/PageSize | [2385 4008] | |
26 | -dict- | |
/PageSize | [2004 2385] | |
27 | -dict- | |
/PageSize | [1417 2004] | |
28 | -dict- | |
/PageSize | [1001 1417] | |
29 | -dict- | |
/PageSize | [709 1001] | |
30 | -dict- | |
/PageSize | [499 709] | |
31 | -dict- | |
/PageSize | [354 499] | |
32 | -dict- | |
/PageSize | [2599 3677] | |
33 | -dict- | |
/PageSize | [1837 2599] | |
34 | -dict- | |
/PageSize | [1298 1837] | |
35 | -dict- | |
/PageSize | [918 1298] | |
36 | -dict- | |
/PageSize | [649 918] | |
37 | -dict- | |
/PageSize | [459 649] | |
38 | -dict- | |
/PageSize | [323 459] | |
39 | -dict- | |
/PageSize | [612 936] | |
40 | -dict- | |
/PageSize | [612 936] | |
41 | -dict- | |
/PageSize | [283 420] | |
42 | -dict- | |
/PageSize | [396 612] | |
43 | -dict- | |
/PageSize | [2385 4008] | |
44 | -dict- | |
/PageSize | [2004 2385] | |
45 | -dict- | |
/PageSize | [1417 2004] | |
46 | -dict- | |
/PageSize | [1001 1417] | |
47 | -dict- | |
/PageSize | [709 1001] | |
48 | -dict- | |
/PageSize | [499 709] | |
49 | -dict- | |
/PageSize | [354 499] | |
50 | -dict- | |
/PageSize | [2920 4127] | |
51 | -dict- | |
/PageSize | [2064 2920] | |
52 | -dict- | |
/PageSize | [1460 2064] | |
53 | -dict- | |
/PageSize | [1032 1460] | |
54 | -dict- | |
/PageSize | [729 1032] | |
55 | -dict- | |
/PageSize | [516 729] | |
56 | -dict- | |
/PageSize | [363 516] | |
57 | -dict- | |
/PageSize | [1224 792] | |
58 | -dict- | |
/PageSize | [612 1008] | |
59 | -dict- | |
/PageSize | [612 792] | |
60 | -dict- | |
/PageSize | [612 792] | |
61 | -dict- | |
/PageSize | [612 792] | |
62 | -dict- | |
/PageSize | [612 792] | |
63 | -dict- | |
/PageSize | [612 792] | |
64 | -dict- | |
/PageSize | [0 0 524287 524287] |